Kubernetes node CPU utilization Kubernetes node CPU utilization kubernetes kubernetes

Kubernetes node CPU utilization


You can a combination of the HPA or/and Cluster autoscaler and/or the cloud providers' autoscaling group.

  • HPA based on CPU/Memory of your pods and scale up and down your K8s Deployments for example.

  • Cloud provider ASG or autoscaling group. Using the VMs or instances based and you can scale up and down based on their own CPU and memory metrics.

  • Cluster autoscaler. It works when pods are pending and they have nowhere to run, but if you are handling the case above this is more of a safe fail mechanism or perhaps for workloads that don't require to come up very quickly.

In summary, you can use all 3 above (or less) but you have to see what works for you so that they don't conflict with each other. One potential problem is that when your cloud ASG starts scaling down then you also have pods in pending state then your cluster autoscaler (if you have it enabled) will kick in and you may have both of them trying to do the opposite causing your cluster to just not being able to schedule any pod.

✌️☮️