Cluster Autoscaler
Kubernetes node-count autoscaling tool
The Cluster Autoscaler is a Kubernetes tool that automatically adds or removes worker nodes in a cluster based on whether pods are unschedulable due to insufficient resources or nodes are significantly underutilized.
Definition
The Cluster Autoscaler is a Kubernetes tool that automatically adds or removes worker nodes in a cluster based on whether pods are unschedulable due to insufficient resources or nodes are significantly underutilized.
Overview
The Cluster Autoscaler operates one level below the Horizontal and Vertical Pod Autoscalers: instead of changing how many pods run or how much each pod is allocated, it changes how many nodes exist in the cluster to make those pod-level decisions possible. When the Horizontal Pod Autoscaler adds new replicas and the cluster doesn't have enough free CPU or memory to schedule them, those pods sit in a `Pending` state; the Cluster Autoscaler detects this and requests additional nodes from the underlying cloud provider or infrastructure platform. Conversely, when nodes are significantly underutilized and all of their pods could be rescheduled elsewhere in the cluster without exceeding other nodes' capacity, the Cluster Autoscaler can scale the cluster down by draining and removing those nodes, subject to any Pod Disruption Budgets that limit how quickly pods can be evicted. This scale-down behavior respects several safety checks by default, refusing to remove nodes running pods that can't be safely rescheduled — for example, pods with local storage that isn't replicated, or pods without a controller managing them. Cluster Autoscaler integrates with cloud-provider-specific node group or node pool APIs — Auto Scaling Groups on AWS, node pools on GKE, and Virtual Machine Scale Sets on Azure — treating each group as a scalable unit it can grow or shrink. Newer alternatives like Karpenter, originally built for AWS, take a more flexible approach by provisioning individual nodes with just-in-time sizing rather than working through predefined node groups, often achieving faster and more cost-efficient scaling decisions. Because node provisioning takes real time — often one to several minutes depending on the cloud provider and image — Cluster Autoscaler's reaction time is inherently slower than pod-level autoscaling, which is one reason clusters are often provisioned with some baseline headroom rather than scaling from zero for latency-sensitive workloads.
Key Features
- Adds nodes when pods are unschedulable due to insufficient capacity
- Removes nodes when they are significantly underutilized
- Integrates with cloud-provider node group and scaling APIs
- Respects Pod Disruption Budgets during scale-down operations
- Works alongside Horizontal and Vertical Pod Autoscalers, not in place of them
- Slower reaction time than pod-level autoscaling due to node provisioning delay
- Alternatives like Karpenter offer more flexible, just-in-time node provisioning