The problem:
HPA showed CPU at 90% but REPLICAS stayed at 1. kubectl get hpa showed <unknown>/50% in the TARGETS column.
The fix:
# Check HPA status — look for "unable to get metrics"
kubectl describe hpa my-app-hpa
# Output showed:
# "unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API"
# → metrics-server not installed or not working
# Check if metrics-server is running
kubectl get pods -n kube-system | grep metrics-server
# Install metrics-server if missing:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
# On kubeadm clusters with self-signed certs, add this flag:
# Edit the metrics-server deployment and add to args:
# - --kubelet-insecure-tls
# Verify it works after:
kubectl top nodes
kubectl top podsWhy it happens:
HPA relies on the Kubernetes Metrics API to get CPU/memory data. If metrics-server isn't installed, the HPA can't read metrics and shows <unknown> — it won't scale up or down. Common in self-managed clusters where metrics-server isn't installed by default. Managed clusters (EKS, GKE, AKS) include it automatically.