Giter VIP home page Giter VIP logo

phpa's Introduction

PHPA: Poor man's Horizontal Pod Autoscaler

PHPA takes metrics from our InfluxDB and Graphite and then scales a deployment based on those metrics.

Before building PHPA, we actually looked at Horizontal Pod Autoscaler but we found that it only scales based on CPU and Memory usage whereas our needs were different. We wanted to scale based on metrics present in our monitoring systems (Graphite and InfluxDB). After looking into custom metrics for HPA, we figured out that it was very complicated, was mostly tied to Prometheus, didn't have great support for Graphite, and also required knowledge of GoLang.

Also during the time, Knative was released. After looking into it, we figured out that it was still in alpha and required running multiple components, which would eventually result in operational complexity.

Hence, we decided to build PHPA.

Read more on how we built PHPA on our blog: Introducing PHPA: Our Kubernetes Horizontal Pod Autoscaler

Deployment

Service Account (One Time Setup)

  • Setup phpa-service-account using setup-access.yaml
  • Check for service account kubectl get serviceaccount phpa-service-account

Deploy

At Clarisights, we run PHPA as a Kubernetes deployment in same cluster as the deployment PHPA is auto-scaling. You can even run it as a Kubernetes CronJob.

  1. Build Docker image
docker build -t phpa:latest https://github.com/clarisights/phpa.git
  1. Push Docker image to your container registry
  2. Create config map from file with your PHPA config files
kubectl create configmap phpa-configs --from-file <configs_dir>/ --dry-run -o yaml
  1. Mount config map in your PHPA cronjob/deployment
  2. Deploy

Look in examples folder for example configs and deployment files.

Contributing

Clarisights uses GitHub to manage reviews of pull requests.

PHPA is written in Ruby. You need to install Ruby and Bundler - check Dockerfile for the instructions.

  1. Fork this repo
  2. Create a branch and add your features
  3. Send your Pull Requests and tag contributors for review

We use Rspec for testing.

Have questions or problems using PHPA?

  • Create an issue and tag contributors

Future Plans

Eventually, we would want to migrate PHPA to a Custom Kubernetes Controller and use Kubernetes CRD (CustomResourceDefinition) for PHPAConfig. Along with that having support for more metric server adaptors would be nice to have as well.

Other Info

phpa's People

Contributors

dependabot[bot] avatar electron0zero avatar rast-7 avatar srijancse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.