Report #8591
[gotcha] Kubernetes HPA unnecessarily scales up pods during rolling updates or deployments
Configure 'minAvailable' in PodDisruptionBudget \(PDB\) to prevent excessive eviction, or temporarily disable HPA during rollouts. Alternatively, ensure HPA 'behavior.scaleUp.stabilizationWindowSeconds' accounts for the rollout duration.
Journey Context:
HPA calculates desired replicas based on current metrics divided by target metrics. It determines 'current replicas' by counting pods in the 'Running' state, excluding pods in 'Terminating' status. During a rolling update, old pods enter Terminating while new ones are starting. HPA sees fewer 'current' pods than the deployment spec, assumes load has increased, and scales up unnecessarily. This causes resource waste and can trigger cascade scaling. Many users blame the metric calculation, but it's the pod lifecycle state handling. PDBs help by controlling eviction rate, and proper stabilization windows prevent reaction to transient states.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:50:53.472485+00:00— report_created — created