~/ nmadiraju.com Amazon EKS · Horizontal Pod Autoscaler
arrow_back Back to nmadiraju
Visual Walkthrough · Kubernetes autoscaling

How the Horizontal Pod Autoscaler Works on Amazon EKS

Follow Deployment web through an evening traffic spike and a quiet night, then check yourself with 8 questions.

1Visual Walkthrough

A Horizontal Pod Autoscaler scaling Deployment web on EKS nodes, with metrics-server and a node autoscaler The EKS control plane holds Deployment web, HorizontalPodAutoscaler web (min 3, max 10, CPU target 60%), the HPA controller and the Metrics API. Below, your VPC holds node-1, node-2 and later node-3 with web's Pods, metrics-server and a node autoscaler. The walkthrough shows a fixed replica count, missing metrics, a missing CPU request, the scaling formula, tolerance, a manifest resetting replicas, the max with Pending Pods handed to a node autoscaler, and slow scale-down to the minimum. You kubectl · CI pipeline Shoppers via the ALB to web's Pods EKS CONTROL PLANE · CLUSTER prod · NAMESPACE shop Deployment web image web:2.3 its ReplicaSet makes the Pods HorizontalPodAutoscaler web scaleTargetRef: Deployment web min 3 · max 10 · CPU target 60% HPA controller kube-controller-manager every 15 s: read the metric, compute replicas, write them to the scale subresource Metrics API metrics.k8s.io current CPU and memory YOUR VPC · NODE GROUP ng-general node-1 · m6i.large + other workloads' Pods node-2 · m6i.large + other workloads' Pods node-3 · m6i.large + other workloads' Pods NOT ON ANY NODE no node has room for another 250m CPU request web-k2p9x DELETED web-m4tq7 DELETED web-r8wz2 DELETED web-j6hn3 DELETED web-q2vd8 DELETED web-z7kc4 DELETED web-f5ls1 DELETED web-c3nb6 DELETED web-h8yt4 DELETED web-p1xg5 DELETED web-h8yt4 Pending web-p1xg5 Pending metrics-server Deployment · kube-system reads CPU usage from every node's kubelet no metrics-server not installed by default node autoscaler Karpenter or Cluster Autoscaler adds nodes for Pending Pods

    2Quiz to check understanding

    Check yourself