When kubernetes nodes start autoscale ?

I have a Kubernetes cluster with autoscale nodes. I increased traffic to my app so that CPU usage was on average 85%. When autoscale should start scaling nodes?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @vtr0n,

The Kubernetes Cluster Autoscaler (CA) is used to automatically adjusts the size of a Kubernetes cluster by adding or removing nodes based on the cluster’s capacity to schedule pods.

What you need in your case is to enable Horizonal Pod Autoscaler (HPA). That way Pod creation and destruction can be automated by a HPA, which monitors the resource use of nodes and generates pods when certain events occur, such as sustained CPU spikes, or memory use surpassing a certain threshold.

This, combined with a CA, gives you powerful tools to configure your cluster’s responsiveness to resource demands — an HPA that ensures synchronicity between resource use and the number of pods, and a CA that ensures synchronicity between the number of pods and the cluster’s size.

For a walkthrough that builds an autoscaling cluster and demonstrates the interplay between an HPA and a CA, see Example of Kubernetes Cluster Autoscaling Working With Horizontal Pod Autoscaling.

Hope that this helps! Regards, Bobby