error: Metrics API not available / HPA: unable to get metrics for resource cpu
metrics-server isn’t installed or isn’t working, so kubectl top and CPU/memory HorizontalPodAutoscalers have no data.
Metrics API not availableunable to get metrics for resource cpufailed to get cpu utilization Meaning
kubectl top and resource-based HPAs read the metrics.k8s.io API served by metrics-server. HPAs then show <unknown>/50% and FailedGetResourceMetric. On kind/minikube/self-signed kubelets, metrics-server often needs --kubelet-insecure-tls; pods also need CPU requests for percentage targets.
Common causes
- metrics-server not installed
- metrics-server can’t scrape kubelets (TLS/self-signed certs)
- APIService v1beta1.metrics.k8s.io unavailable
- Pods without CPU requests (HPA percentage can’t be computed)
⚡ Quick fix
- Install metrics-server
- Check kubectl get apiservice v1beta1.metrics.k8s.io
- Set resources.requests.cpu on the pods
Detailed fix by platform
Kubernetes
- bash
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml kubectl -n kube-system logs deploy/metrics-server | tail kubectl get apiservice v1beta1.metrics.k8s.io
How to diagnose
- Server — metrics-server pod running?
- APIService — Available True?
- Requests — CPU requests set?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Kubernetes
- cannot re-use a name that is still in use Error: INSTALLATION FAILED: cannot re-use a name that is still in use
- error converting YAML to JSON error converting YAML to JSON: yaml: line 12: did not find expected key
- FailedCreatePodSandBox Failed to create pod sandbox: plugin type="calico" failed (add): ... (FailedCreatePodSandBox)
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026