Running workloadsLesson 8 of 14
Scaling with Load (HPA)
A service that normally runs fine on two Pods suddenly gets a flood of requests. Follow how the HPA (Horizontal Pod Autoscaler) notices and adds Pods.
Avg CPU usage40%
Current Pods2
Desired Pods2
RequestResponse / reportAppears in a later step
What you will learn
- Where usage is measured and how it reaches the HPA
- How the HPA calculates the desired Pod count
- The HPA only changes the count; the scheduler does placement
- Scaling stops at Pending when nodes run out of room
- Why scale-in is deliberately slow
When the HPA does not behave as expected
| Symptom | What to check |
|---|---|
Usage shows as <unknown> | Whether metrics-server is running, and whether the Pods declare resource requests |
| Desired Pods went up but the Pod is Pending | Free resources on nodes, namespace quota |
| Load dropped but Pods stay | Whether the scale-in stabilization window has passed, the minimum replica count |
Try it yourself
kubectl top pods # Per-Pod usage metrics-server collected
kubectl get hpa -A # Target vs current usage, current Pod count
kubectl describe hpa <name> # Scaling events and conditions
kubectl get pods -A --field-selector=status.phase=Pending # Pods stuck for lack of node room
Check yourself
Further reading: Horizontal Pod Autoscaling · HPA Walkthrough