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, or getting started guide for more information.