Scaling with Kubernetes Event-Driven Autoscaling
KEDA is an open source framework that allows you to scale K8s workloads based on metrics or events. We do this by deploying the KEDA operator, which manages all the required components, broadly consisting of the following:
- An agent, responsible for scaling the deployment up or down depending on events.
- A metrics server that exposes metrics from applications or external sources.
- A ScaledObject custom resource that maintains the mapping between the external source or metric and the K8s deployment, as well as the scaling rules. This effectively creates a corresponding HPA Kind.
- Internal and external event sources that are used to trigger a KEDA action.
The following diagram illustrates the main KEDA components.
Figure 18.11 – Main KEDA components
Now we’ve looked at the concepts behind the KEDA custom metrics, let’s install and test it.