HorizontalPodAutoscaler unable to fetch metrics — HPA not scaling
HPA currentMetrics shows <unknown> or targets stuck at 0%
Focused incident mode — strips away everything but this runbook.
Symptoms
- HPA currentMetrics shows <unknown> or targets stuck at 0%
- HPA does not scale up despite high load
- kubectl describe hpa shows unable to fetch metrics from custom metrics API
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
HPA status
kubectl describe hpa <hpa> -n <namespace>Metrics API availability
kubectl get --raw /apis/metrics.k8s.io/v1beta1
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- kubectl get --raw /apis/metrics.k8s.io/v1beta1 returns error
- No metrics-server pods running
Confirm before fixing
kubectl get pods -n kube-system -l k8s-app=metrics-serverCheck metrics-server replicas
Fix
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlInstall metrics-server from the official manifest
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
kubectl get --raw /apis/metrics.k8s.io/v1beta1Confirm the metrics API is reachable
kubectl describe hpa <hpa> -n <namespace>Read the scaling conditions and error messages
kubectl get pods -n kube-system -l k8s-app=metrics-serverCheck metrics-server health
kubectl rollout restart deployment/metrics-server -n kube-systemRestart metrics-server if it is crashing
Prevention
- Monitor metrics-server pods and alert if any replica is not Ready.
- Test HPA scaling in staging before production to confirm metrics flow.
- Usekubectl top pods regularly to verify the metrics API is healthy.
- Document custom metrics names and validate them in Prometheus before wiring the HPA.
Related runbooks
Same stack, same failure family — worth a skim.
kubectl top pods returns error: metrics not available
High response latency with low CPU saturation on the node
kubectl get pods shows Pending for minutes
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.