Journeys · Kubernetes · L2

An HPA scaling up

Every 15 seconds one controller reads a number, does one division, rounds up, and writes a replica count.

✓ Validated on v1.37.2 · validation Run 1 · 2026-11-21Preview

The 30-second answer

The HPA controller runs inside kube-controller-manager. Every 15 seconds it asks the resource metrics API, served by metrics-server, for each Pod's CPU. It divides the average by the request to get a utilisation, divides that by your target, multiplies by the current replicas and rounds up. New Pods without a fresh reading count as 0% when it scales up. The result is capped by maxReplicas and the scale-up policies. Then it writes the Deployment's scale subresource, and the Deployment and ReplicaSet controllers make the Pods.

Mental model

A chaat stall with a manager and a clipboard. Every 15 seconds the manager looks at how hard each cook is working and writes down how many cooks the stall needs: today's work divided by the comfortable work per cook, rounded up. If the number is higher, the manager calls more cooks, up to the stall's limit.

Where the analogy breaks

A real manager would count a cook who arrived a minute ago. The HPA does not trust a new Pod's first reading. It counts the newcomer as idle until it has a fresh number, so it scales up more slowly than the arithmetic on the screen suggests.

🔒 Free account

Sign up free to play this journey

A free account unlocks every scenario, journey and exam, and saves your progress. No payment, ever.