kubernetes
autoscaling
ai_generated
true
unable to calculate desired number of replicas: missing request for cpu
ID: kubernetes/horizontal-pod-autoscaler-unable
94%Fix Rate
96%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
| 8 | active | — | — | — |
Root Cause
HPA cannot scale because pods don't have CPU/memory resource requests defined.
genericWorkarounds
-
96% success Add resource requests to the pod spec: resources.requests.cpu: 100m
HPA needs resource requests to calculate utilization percentage
Sources: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
-
88% success Use metrics-server to verify metrics are available: kubectl top pods
HPA requires metrics-server to be installed and running
Dead Ends
Common approaches that don't work:
-
Setting arbitrary resource requests
55% fail
Over or under-provisioning; either wastes resources or causes OOM
-
Using memory-based scaling instead
55% fail
Memory scaling is less responsive than CPU for most workloads
Error Chain
Frequently confused with: