metrics-server missing or down — kubectl top fails with no metrics known
kubectl top pods returns error: metrics not available
Focused incident mode — strips away everything but this runbook.
Symptoms
- kubectl top pods returns error: metrics not available
- kubectl top nodes fails with the server could not find the requested resource
- HPA stuck unable to fetch metrics
metrics-server is the foundation for kubectl top, VPA, and CPU/memory-based HPA. Its absence silently degrades autoscaling for the entire cluster.
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
kubectl top error
kubectl top pods -n <namespace>Metrics API check
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
- No metrics-server pods in kube-system
- kubectl get --raw /apis/metrics.k8s.io/v1beta1 returns error
Confirm before fixing
kubectl get pods -n kube-system -l k8s-app=metrics-serverCheck for metrics-server
Fix
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlInstall metrics-server
Expected: serviceaccount/metrics-server created
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/v1beta1Check metrics API registration
kubectl get pods -n kube-system -l k8s-app=metrics-serverVerify pod is running
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlInstall if missing
kubectl rollout restart deployment/metrics-server -n kube-systemRestart if crashing
kubectl top pods -n <namespace>Verify metrics are flowing again
Prevention
- Install metrics-server as part of cluster bootstrap (Terraform/Helm).
- Alert on metrics-server pod restarts or metrics API 503.
- For managed clusters, verify the cloud provider does not install it by default.
- Use Prometheus for long-term metrics; metrics-server is for real-time only.
Related runbooks
Same stack, same failure family — worth a skim.
HPA currentMetrics shows <unknown> or targets stuck at 0%
High response latency with low CPU saturation on the node
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.