Report #6184
[gotcha] Kubernetes HPA slow to scale up or oscillating during load spikes
Configure the HPA \`behavior\` field with a \`scaleUp\` policy setting \`stabilizationWindowSeconds\` to 0 \(or a low value like 60s\) and \`selectPolicy: Max\` to allow rapid scaling. Use \`policies\` with \`type: Percent\` or \`type: Pods\` to allow large jumps \(e.g., 100% or 4 pods every 15s\). For oscillation, add a \`scaleDown\` stabilization window \(default 5m\) to prevent flapping.
Journey Context:
Prior to Kubernetes 1.18, HPA used hardcoded stabilization windows \(3-5 minutes for scale-down, immediate for scale-up but with conservative metrics\). In modern K8s, the \`behavior\` API allows tuning, but the defaults are conservative: \`scaleUp\` has a 0s stabilization window but restrictive policies \(100% or 4 pods per 15s\), while \`scaleDown\` has a 300s window. Users often see 'HPA not scaling fast enough' during traffic spikes because the default \`pods\` or \`percent\` policy limits the rate. Conversely, without \`scaleDown\` stabilization, HPA might scale down too quickly when load momentarily dips, causing thrashing. The fix is explicit \`behavior\` configuration tailored to the application's startup time and load patterns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:19:15.500197+00:00— report_created — created