Report #6932
[gotcha] Kubernetes HPA not scaling despite high CPU in main application container
Use HPA v2 'ContainerResource' metric type to target the specific container by name, rather than the default 'Resource' type which averages across all containers including sidecars.
Journey Context:
A pod has a main app container \(100m CPU request, 80m usage = 80%\) and a sidecar \(100m request, 5m usage\). HPA calculates utilization as total usage \(85m\) divided by total requests \(200m\) = 42.5%. The app is actually at 80% but HPA sees 42.5%, refusing to scale. Developers waste hours checking metrics-server and HPA yaml. The fix requires HPA v2 \(K8s 1.27\+\) with a 'containerResource' stanza specifying 'container: app' and 'resource: cpu', decoupling the scaling signal from sidecar overhead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:21:08.075594+00:00— report_created — created