Services

Resources

Company

/

Cluster autoscaler

Cluster Autoscaler

A cluster autoscaler is a component that changes the number of nodes in a Kubernetes cluster. It adds a node when pods are stuck in Pending because no node has room for them, and removes a node when its pods fit elsewhere. The best known is the open source Kubernetes Cluster Autoscaler, which resizes cloud node groups.

How it works

The autoscaler decides from pod resource requests, not live CPU usage. It scans the cluster every 10 seconds by default.

  • Scale up: 5 pending pods each request 3 vCPU. Nodes have about 7.5 vCPU free for pods, so 2 pods fit per node and the autoscaler asks the node group for 3 more nodes.

  • Scale down: a node whose pods request less than 50% of its capacity for 10 minutes is a candidate. The autoscaler drains it if its pods can move.

Why it matters in production

The Horizontal Pod Autoscaler creates pods, but they only run if a node exists. The cluster autoscaler closes that gap and removes idle capacity you would otherwise pay for. New nodes take minutes to boot, so spiky services still need some headroom.

See also

On the One2N blog

Further reading

Cluster autoscaler shown as a flow: 5 Pending pods, each asking for 3 vCPU, go to the autoscaler, which checks every 10 seconds and adds 3 nodes. Each new node has 7.5 vCPU free, so 2 pods fit per node and the pods land 2, 2 and 1. A red clock next to the new nodes says boot takes minutes.

Putting this into practice?

Talk to One2N about our platform engineering services

Talk to One2N about our platform engineering services