An HPA shows TARGETS <unknown>/80% and never scales — diagnose the missing metrics path.
An HPA is not scaling under obvious load. Below is what you see. Explain why TARGETS reads <unknown> and how you restore scaling — it is not a threshold or a min/max problem.
$ kubectl get hpa api
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
api Deployment/api <unknown>/80% 2 10 2 15m
$ kubectl describe hpa api
Warning FailedGetResourceMetric unable to get metrics for resource cpu:
no metrics returned from resource metrics API
Warning FailedComputeMetricsReplicas invalid metrics (1 invalid out of 1)
$ kubectl top pods
error: Metrics API not available
Give the diagnosis and the fix.
<unknown> means the HPA cannot read the metric, so it computes no desired replica count. kubectl top failing points at the root: no metrics-server, so the resource-metrics API returns nothing. Repair the metrics-server, and confirm Pods declare CPU requests — a CPU% target needs a base. It is not a threshold or min/max issue.
- ✗Lowering the target percentage instead of restoring the metrics pipeline
- ✗Ignoring that a failing
kubectl topsignals a missing metrics-server - ✗Forgetting that a CPU% target needs Pod requests to compute
- →Why does a CPU-percentage HPA need the Pods to declare CPU requests?
- →How would you tell a metrics-server outage from a missing custom-metrics adapter?
Solution
<unknown> in TARGETS is not a "wrong threshold" or "bad bounds" problem. It means the HPA received no metric value, so it cannot compute a desired replica count and leaves the replicas untouched.
describe → FailedGetResourceMetric ... no metrics returned. The metrics.k8s.io source is empty: the metrics-server is not installed or is unhealthy.
verify its Pod is Running and the APIService v1beta1.metrics.k8s.io is available.
usage ÷ request; with no request there is no base, and the metric stays <unknown> even with a healthy metrics-server.
- The root is visible in
kubectl top pods→Metrics API not available, and in - Fix: install or repair the metrics-server (via its Helm chart or manifest), and
- Separately, confirm the Pods set
resources.requests.cpu— a CPU% target is
# metrics-server healthy → top works → the HPA gets a metric
kubectl -n kube-system get deploy metrics-server
kubectl top pods # should return CPU/MEM, not an error
kubectl get apiservice v1beta1.metrics.k8s.io # AVAILABLE=True