1

We have our cluster setup in GKE and scaling our pods with 'external metrics' from stack-drive. The scaling works fine, but when I try to see the status with command

$ kubectl get hpa

It shows 'unknown type' in TARGET instead of the actual value as below.

NAME                      REFERENCE                            TARGETS          MINPODS   MAXPODS   REPLICAS   AGE
accounts-service          Deployment/accounts-service          <unknown type>        1         200       1          15d

My current kubectl version shows as

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.6", GitCommit:"6260bb08c46c31eea6cb538b34a9ceb3e406689c", GitTreeState:"clean", BuildDate:"2017-12-21T06:34:11Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.5-gke.4", GitCommit:"0c81dc1e8c26fa2c47e50072dc7f98923cb2109c", GitTreeState:"clean", BuildDate:"2018-12-07T00:22:06Z", GoVersion:"go1.10.3b4", Compiler:"gc", Platform:"linux/amd64"}

Has anyone faced similar problem?

arunk2
  • 2,246
  • 3
  • 23
  • 35

2 Answers2

0

In my case I had to add the following flag to kube-controller of all masters.

horizontalPodAutoscalerUseRestClients: true

mr.franco
  • 43
  • 1
  • 6
  • We are using GKE and kube-controller is abstracted. GKE version 1.9+ has this field enabled. Also, the scaling part is working... when I do a kubectl describe hpa => it says the 'ScalingActive True ValidMetricFound the HPA was able to successfully calculate a replica count from external metric custom.googleapis.com|app_queue_length' .i.e.. server side its fine. Some thing is missing in kubectl-cli I guess. – arunk2 Dec 26 '18 at 13:57
  • Upgrading the kubectl client in my machine solved this issue. Thanks for sharing ur experience! – arunk2 Dec 26 '18 at 14:10
0

Actually upgrading the kubectl client in my machine solved this issue.

I followed the steps per the accepted answer and it showed the 'External Metric' as expected. How to upgrade kubectl client version

Posting it just in case someone else face the same issue.

arunk2
  • 2,246
  • 3
  • 23
  • 35