jthomperoo / locust-pod-autoscaler

Latency based Kubernetes autoscaler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build codecov Documentation Status License

Locust Pod Autoscaler

This is the Locust Pod Autoscaler, a Kubernetes Custom Pod Autoscaler that uses latency to scale.

This is project is built using the Custom Pod Autoscaler Framework.

What is it?

This is a Custom Pod Autoscaler for Kubernetes, powered by Locust to run load tests to retrieve latency statistics.
This autoscaler allows you to write your own Locust tests to load test your Kubernetes applications, then provides simple configuration for scaling based on the results of these. For example an autoscaler could be created that gathers latency statistics every minute for a REST API, if the average latency goes above 50ms then the application should be scaled up.

How does it work?

The autoscaler works by running Locust tests you create in Python, then gathering the statistics from these before comparing with configured target latencies.
Accompanying this upscaling based on latency is the idea of a decay, which can be configured as part of the autoscaler. The decay works by waiting for a number of runs of the autoscaler in which the number of replicas hasn't changed, and reducing the replica count by a configured amount. This allows flexiblity in conservatively or aggressively downscaling, and if it downscales too far the autoscaler will scale back up again based on latency tests.

See the example, getting started guide, or the wiki for further information.

Getting started

Check out this getting started guide for a quick start for developers.

More information

See the wiki for more information, such as guides and references.

Developing this project

Environment

Developing this project requires these dependencies:

Python development dependencies can be installed with:

pip install -r requirements-dev.txt

Project dependencies can be installed with:

pip install -r requirements.txt

To view docs locally, requires:

Commands

  • make - builds the Docker image
  • make lint - lints the code.
  • make unittest - runs the unit tests.
  • make doc - hosts the documentation locally, at 127.0.0.1:8000.

About

Latency based Kubernetes autoscaler.

License:Apache License 2.0


Languages

Language:Python 90.9%Language:Dockerfile 7.8%Language:Makefile 1.4%