Kubernetes is an excellent container orchestration platform, but when it comes to AutoScaling of containers, there is limited capability with just CPU & memory metrics scaling applications. This talk will introduce how can the combination of KEDA & Azure Kubernetes Service can help AutoScaling of applications based on metrics from various metric sources, eg. Prometheus, Kafka, etc.
8. ▸ This type of Scaling depends on human action to scale the
application
$ Kubectl scale deployment/my-app --replicas=2
Similar operation can be done for cluster Autoscaling using az cli
8
Manual Scaling
9. ▸ This type of Scaling depends on system metrics to scale the
application
$ Kubectl autoscale deployment/my-app --max=5 --cpu-percent=80
Limited by metric types which can be used out of the box
9
Horizontal pod Autoscaler (HPA)
10. ▸ This type of Scaling implements Virtual Kubelet in AKS cluster.
▸ Azure container instances(ACI) are responsible for running extra
pods without any additional infrastructure required.
10
Virtual Nodes
12. ▸ This type of Scaling can use metrics from different sources.
▸ Uses HPA in backend for actual scaling
▸ Can be used in combination with Virtual Node
12
Event Driven Scaling
14. 14
KEDA is a Kubernetes-based Event Driven Autoscaler
15. KEDA works alongside standard Kubernetes components like the Horizontal
Pod Autoscaler and can extend functionality without overwriting or
duplication.
Roles of Keda-operator:
▸ Agent - KEDA activates and deactivates Kubernetes Deployments to
scale to and from zero on no events.
▸ Metrics - KEDA acts as a Kubernetes metrics server that exposes rich
event data like queue length or stream lag to the Horizontal Pod
Autoscaler
15
How does KEDA works?
16. 16
KEDA Architecture
ScaledObjects: Desired mapping
between an event source and the
Kubernetes Deployment
External trigger source:
Prometheus, Kafka, RabbitMQ, etc
Scaler: Detect if a deployment
should be activated or deactivated,
and feed custom metrics for a
specific event source
Metrics adapter: Presents metrics
from external sources to the
Horizontal Pod Autoscaler