aks how does node auto-scaling works

 

According to the documentation, if the memory and cpu request falls below 50%. So both CPU and memory needs to be above 50%. I also noticed that you need to have a k8s deployment. If you do not have a deployment, those nodes just keeps on throttling. 

There will be a wait between 10-30 minutes before you can start seeing auto-scaling.  You don't necessarily need to get your pods on "pending" state for it to scale. 

FAQ for how autoscaling works 

https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-scale-down-work

You can also view the status via kubectl top - which is an accurate account of what's happening. 

You can get the status of your node auto-scaler using the following command 

kubectl describe configmap --namespace kube-system cluster-autoscaler-status


Not using k8s deployment yaml

Pods needs to be in pending state and meets the cpu / memory utilization factor of above 50% to scale. If pods can be scheduled, runnig and NOT in pending state, then auto-scaler will not kick in.

Check out my nodes, more than 100 percent and memory usage about max out - but still no auto-scaler kicks in - because i use kubectl to run a specific image




Please note: For system node, ideally we need to have 2 instance to work. Although you can scale it down to 1 but some affinity warnings would come up atleast for AKS (if you goto AKS->Kubernetes Resource->Event tab


The code  and logic to do autoscaling can be found here

https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/core/static_autoscaler.go#L541

Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm