Kubernetes Event-driven Autoscaling
open sourceApache-2.0self-hostablefree
KEDA scales any container in Kubernetes on the number of events waiting to be processed, from zero up, with a catalog of over 70 built-in scalers for message queues, databases, cloud services and metrics systems such as Kafka, RabbitMQ, AWS SQS and Prometheus. A ScaledObject ties a Deployment or StatefulSet to an event source and a ScaledJob creates Jobs for queued work; the KEDA operator handles scaling between zero and one replica, and its metrics server feeds external metrics to the Horizontal Pod Autoscaler, which it works alongside rather than replacing. TriggerAuthentication resources hold the credentials for event sources, and admission webhooks catch misconfigured resources. KEDA is a CNCF graduated project under Apache-2.0, installed with Helm, Operator Hub or YAML.
Ways to install
On Kubernetes
Problems it solves
- scale my queue workers on how many messages are waiting in Kafka or RabbitMQ, not on CPU
- scale consumer deployments down to zero when the queue is empty and back up when work arrives
- start a Kubernetes Job for each batch of queued work and stop when it's done
- the horizontal pod autoscaler only knows CPU and memory but I need to scale on SQS queue length
- scale a deployment on the result of a Prometheus query
- autoscale event-driven apps on the cluster without running Azure Functions or Lambda
- keep credentials for message brokers and cloud services out of my autoscaling config
- stop paying for idle worker pods overnight when nothing is being processed
- scale HTTP services to and from zero based on incoming traffic
Features
- over 70 built-in scalers (Kafka, RabbitMQ, AWS SQS, Prometheus and more)
- scale to and from zero
- ScaledObject for Deployments and StatefulSets
- ScaledJob to run Jobs for event-driven batch work
- TriggerAuthentication for event source credentials
- keda-metrics-apiserver serving external metrics to the HPA
- admission webhooks validating KEDA resources
- HTTP Add-on (beta) for scaling on HTTP traffic
- Helm chart, Operator Hub and YAML installs
