Coder Social home page Coder Social logo

jthomperoo / custom-pod-autoscaler Goto Github PK

View Code? Open in Web Editor NEW
276.0 10.0 21.0 615 KB

Custom Pod Autoscaler program and base images, allows creation of Custom Pod Autoscalers

License: Apache License 2.0

Dockerfile 4.89% Makefile 0.44% Go 82.10% Python 11.15% Java 1.42%
kubernetes autoscaler autoscaling base-image custom-pod-autoscaler cpa scaling kubernetes-autoscalers docker framework

custom-pod-autoscaler's People

Contributors

dependabot[bot] avatar iroller avatar jthomperoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom-pod-autoscaler's Issues

Manual triggering of Custom Pod Autoscaler evaluation

Rather than being triggered just by the timer and at set intervals, the Custom Pod Autoscaler evaluation could be triggered manually, through a REST endpoint.
This would allow users to send an HTTP request to the Custom Pod Autoscaler and start an evaluation immediately, rather than waiting for the interval to expire.

Metric and Evaluation timeout

Implement a timeout for fetching metrics/evaluations, configurable - stops the CPA being unresponsive if a script fails - i.e due to pod terminating/crashing half way through an evaluation.

Choose which pods to terminate when scaling down

The CPA evaluator could decide which pods to terminate when scaling down, rather than relying on the Kubernetes decision making which bases it on how old the pod is.
This could be a list of pods with priorities assigned to them, with the lowest priority pods terminated when scaling down as needed.

Support scaling to zero

This code seems to be preventing me from scaling a deployment to zero replicas:

if currentReplicas == 0 {

My use case is a queue-based processing system with a bunch of GPUs, so scale to zero is rather important (and also why I can't use the build in HorizontalPodAutoscaler)

Allow specification of how metrics/evaluations should be run

At the minute, the metric is run for every pod in a deployment; however it would be useful if you could run the metric only per deployment, rather than per each pod.

A new configuration option would help this, run-mode, with these options:

  • per-pod - Runs per pod.
  • per-deployment - Runs per deployment.

Expose metrics through an API endpoint

Metrics should be retrievable through an API endpoint:
GET /metrics
Returning:

[
  {
    "deployment": "example-deployment",
    "metrics": [
      {
        "pod": "example-pod",
        "value": "value"
      }
    ]
  }
]

These metrics should be calculated at request time.

Allow different methods to pass data

Would require a change to how the current configuration to support this, e.g. instead of

metric: "shell command"

It should allow you to specify which way to pass data, for shell commands:

metric: 
  type: "pipe"
  pipe: "shell command"

For something like a HTTP request:

metric: 
  type: "http"
  http: 
    method: "GET"
    endpoint: "https://0.0.0.0:5000/metrics"

This would also apply to evaluations, so a more general configuration option to specify a series of different data transfer options would be useful.

Deploy release images to Docker Hub

If a new release is built on GitHub, it should result in a new image being pushed to Docker Hub and that image should be tagged as latest.

Add start time for scaler

Allow setting up a timing for the scaler to start, for example could provide the time:

0001-01-01 00:00:15 +0000 UTC

This would cause the scaler to start only after the next round 15 seconds. This would be set up with a default of

0001-01-01 00:00:00 +0000 UTC

Which would by default just start at the next full minute/hour/second etc.

Handle no deployments being managed

At the minute if there are no deployments, the /evaluate.py script still seems to be being called, with no metric JSON, causing it to error out. If there are no deployments, the evaluation should be skipped.

Cooldown feature

Thrashing is when a deployment is scaled up and down repeatedly in a short period of time, caused by being right on the threshold of an evaluation. For example, if the number of pods in a deployment rapidly changes between 2 and 3 because of small changes in the metrics as it is directly on a boundary/threshold.
The Cooldown feature would allow setting a delay or a cool down period on when to scale, avoiding rapid changes in number of pods for minor changes in the metric being evaluated. For example, a cooldown could be set to not scale again if a deployment has been scaled in the past 5 minutes.

Use vendor for golint

Running golint pulls down dependencies rather than using the vendor directory, slowing down the CI.

Expose evaluations through an API endpoint

Evaluations should be retrievable through an API endpoint:
GET /evaluations
Returning:

[
  {
    "deployment": "example-deployment",
    "evaluation": {
      "target_replicas": 2
    }
  }
]

This evaluation should be calculated at request time.

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.