Horizontal Pod Autoscaler Shows <unknown> Targets
Problem
The Horizontal Pod Autoscaler does not provides any metrics
$ kubectl get hpa
NAME REFERENCE TARGETS
horizontalpodautoscaler.autoscaling/nginx Deployment/nginx-deployment <unknown>/70%
Environment
- Platform9 Managed Kubernetes - All Versions
Cause
All the containers with the deployment need to have Requests and Limits set for HPA to pick up the metrics. This is also true for all sidecar containers that you will deploy within a pod.
Resolution
- Verify that the metrics-server pod is running in your environment
- Check if the pod is reporting its metrics correctly using the metrics endpoint
- After this step check if the HPA is reporting the targets correctly.
- Verify that Requests and Limits are set for all the containers in the pods comprising your deployment.
$ kubectl get pods -n kube-system | grep metric
metrics-server-v0.5.0-5fd89488cd-zpjlg 2/2 Running 0 4m18s
$ kubectl get pods -n kube-system | grep metric
metrics-server-v0.5.0-5fd89488cd-zpjlg 2/2 Running 0 4m18s
$ kubectl get hpa
##
Was this page helpful?