Kubernetes cluster-autoscaler not working

4/16/2018

I have deployed cluster-autoscaler for my aws kube cluster, now it is failing with below error.

W0411 03:07:37.393124 1 clusterstate.go:514] Failed to get nodegroup for dev-k8s-node-asg-230-i-089e4d2f163533989: Wrong id: expected format aws:////, got
W0411 03:07:37.393145 1 clusterstate.go:514] Failed to get nodegroup for stg-k8s-w2-npe-master-3: Wrong id: expected format aws:////, got
W0411 03:07:37.393152 1 clusterstate.go:514] Failed to get nodegroup for dev-k8s-node-prm-1: Wrong id: expected format aws:////, got
W0411 03:07:37.393158 1 clusterstate.go:514] Failed to get nodegroup for dev-k8s-node-asg-230-i-0eb3341fce85be39c: Wrong id: expected format aws:////, got
W0411 03:07:37.393164 1 clusterstate.go:514] Failed to get nodegroup for dev-k8s-node-asg-230-i-091d1a037311d5daf: Wrong id: expected format aws:////, got
W0411 03:07:37.393169 1 clusterstate.go:514] Failed to get nodegroup for dev-k8s-node-asg-230-i-041dd54f2baaa4553: Wrong id: expected format aws:////, got
W0411 03:07:37.393188 1 clusterstate.go:560] Readiness for node group dev-k8s-node-asg-230 not found
W0411 03:07:37.393203 1 clusterstate.go:560] Readiness for node group stg-k8s-agent-w2-asg not found

autoscaler-configuration Command:

./cluster-autoscaler \
  --v=6 \
  --stderrthreshold=info \
  --cloud-provider=aws \
  --skip-nodes-with-local-storage=false \
  --expander=least-waste \
  --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,kubernetes.io/cluster/dev 

I have added below tags to my autoscaling group, can someone help me to understand this error.

-- Sujith
kubernetes

1 Answer

4/16/2018

You may try to create cloud-config.conf and insert KubernetesClusterTag, KubernetesClusterID and Zone properties there. Please verify if

--cloud-provider=aws 

is present at every nodes and in the kubelet command line, and if

--cloud-config=

points to correct path of cloud_config.conf.

-- d0bry
Source: StackOverflow