Repository navigation
Unable to auto-scale Kubernetes cluster #52
Description
Hi!
I am unable to auto-scale Kubernetes clusters. As I understand, it create a "cluster-autoscaler" deployment that decides whether to scale or not. However, it does not seem to work, since it logs multiple errors and warnings in the pod, even though it is a completely clean cluster.
Normal scaling seems to work just fine.
Setup
A "default" CloudStack setup 4.18 running KVMs.
Settings (relevant)
- Cloud kubernetes service enabled true
- Cloud kubernetes cluster experimental features enabled true
- Cloud kubernetes cluster max size 50
The nodes uses the following service offering:
- 2 CPU x 2.05 Ghz
- 2048 MB memory
- 8 GB root disk
Replicate
-
Create a new cluster using Kubernets 1.24 ISO found here:
http://download.cloudstack.org/cks/ -
Enable forced auto-scaling
Since the cluster starts with only one worker node, auto-scaling with 3-5 nodes should trigger an upscale (I assume)

-
Check the logs for cluster-autoscaler in the Kubernetes cluster
Some notable entries:
E0807 14:41:30.317148 1 reflector.go:138] k8s.io/client-go/informers/factory.go:134: Failed to watch *v1.CSIDriver: failed to list *v1.CSIDriver: csidrivers.storage.k8s.io is forbidden: User "system:serviceaccount:kube-system:cluster-autoscaler" cannot list resource "csidrivers" in API group "storage.k8s.io" at the cluster scope
E0807 14:41:32.388828 1 reflector.go:138] k8s.io/client-go/informers/factory.go:134: Failed to watch *v1beta1.CSIStorageCapacity: failed to list *v1beta1.CSIStorageCapacity: csistoragecapacities.storage.k8s.io is forbidden: User "system:serviceaccount:kube-system:cluster-autoscaler" cannot list resource "csistoragecapacities" in API group "storage.k8s.io" at the cluster scope
Even though I have not edited anything myself (just a clean CKS cluster), I get these weird logs:
W0807 14:41:43.251280 1 clusterstate.go:590] Failed to get nodegroup for 6a4c91a3-9694-4596-9ddd-dc86e60136ff: Unable to find node 6a4c91a3-9694-4596-9ddd-dc86e60136ff in cluster
W0807 14:41:43.251361 1 clusterstate.go:590] Failed to get nodegroup for bd0b855f-6dc6-4678-9bea-b52329333024: Unable to find node bd0b855f-6dc6-4678-9bea-b52329333024 in cluster
I0807 14:57:06.667061 1 static_autoscaler.go:341] 2 unregistered nodes present
The IDs are correct in CloudStack
The entire log:
logs-from-cluster-autoscaler-in-cluster-autoscaler-5bf887ddd8-hxg2g.log
Please tell me if you need more logs to look at, or if I should try some other configuration.
Thanks!
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
yadvr commentedon Aug 7, 2023
cc @Pearl1594 @weizhouapache @DaanHoogland pl help triage when you've time
@saffronjam this looks like an issue with k8s autoscaler (https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/cloudstack/README.md) or with CKS (upstream https://github.com/apache/cloudstack)
kiranchavala commentedon Feb 28, 2024
Hi @saffronjam
The autoscaling feature works fine on a k8s cluster deployed by CKS.
Please find the steps that i have followed
After you enable autoscaling on the cluster
Make sure the autoscaling pod is deployed in the cluster
Before scaling
Deploy a application
kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=80Scale the application
kubectl scale --replicas=150 deployment/hello-nodelogs from the autoscaler pod
weizhouapache commentedon May 22, 2024
I notice @saffronjam used a regular user to deploy the CKS cluster, would it be related to the issue ?
Jayd603 commentedon Mar 17, 2025
I just had this happen on 4.19.1 and not sure why. "Failed to get node group for" all nodes. Anyone know how to correct this manually when it happens? I tried disabling auto scaling and re-enabling but that didn't work.
https://hub.docker.com/r/apache/cloudstack-kubernetes-autoscaler is old 1.0.0 - when i built the latest kubernetes ISO it still used this, i'm assuming this is broken on newer kubernetes version and users need to implement: https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/cloudstack ?