Getting Unkown target for HPA

10/5/2021

Am actually new to kubernetes, but as now am good with the terms such as deployment, pods etc. Well i was trying an example of HPA (Horizontal pod autoscaler), and as prerequisite metrics-servers is already integrated, but after all those things am not able to see HPA working as expected enter image description here When execute below cmd- Kubectl get hpa

Unknown in the target, although i have tried all my luck referring online forum but didn't got any break through Any help would be really appreciated

Thank you

-- Narayanan Kutty
google-kubernetes-engine
hpa
kubernetes
kubernetes-helm
kubernetes-pod

2 Answers

10/6/2021

Try this test

MENU > Kubernetes Engine> Workloads > Deploy > deploy the default nginx

MENU > Kubernetes Engine> Workloads > nginx deployment > actions > autoscale

The reason you might want to try this it so isolate the issue. If the above works then issue is with your file/setup. Usually everything default should work. If it fails then you have a bigger issue as in a GKE issue/version issue or metric server issue.

This was not meant as an answer, i put it here as i did not have enough space to put in comments.

-- dany L
Source: StackOverflow

4/21/2022

I was getting same issue, fixed after adding cpu requests in my pod defination. Below points can be the reason in most of the cases

  • Metric server is not installed in your kubernates cluster, you can check with command (kubectl get deploy,svc -n kube-system | egrep metrics-server)
  • Check if you have provided resources for deployment/sts/pod definations
-- Nikhil Lingam
Source: StackOverflow