The Cluster Autoscaler and Karpenter
Adding and removing nodes automatically: the Cluster Autoscaler grows node groups for Pending Pods, Karpenter provisions nodes directly and consolidates.
How the scheduler places PodsDisruptions, drains and PodDisruptionBudgetsThe Horizontal Pod Autoscaler
The Cluster Autoscaler and Karpenter
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Node autoscalers react to Pods the scheduler couldn't place (PodScheduled False, reason Unschedulable), not to CPU usage. Requests drive everything.
- The Cluster Autoscaler simulates the scheduler against templates of existing node groups, picks one with an expander (least-waste by default), and raises that group's size in the cloud.
- It removes a node once its Pods' requests are under 50% of allocatable and every Pod can move elsewhere, after 10 minutes unneeded, evicting Pods with respect for PodDisruptionBudgets.
- Karpenter has no node groups. A NodePool states constraints (instance families, architectures, spot or on-demand, limits) and Karpenter launches the cheapest instance that fits the pending Pods.
- Karpenter's disruption controller consolidates, replacing or deleting underused nodes, and also replaces drifted or expired nodes, within disruption budgets (10% of nodes by default).
- Pods block scale-down when they can't be moved: no controller, local storage, a PDB at its limit, or a do-not-evict annotation (safe-to-evict: false, karpenter.sh/do-not-disrupt).
Pod autoscaling eventually runs out of room
The HPA can ask for 40 replicas, but each needs a node with room for its requests. When the nodes are full, new Pods sit Pending and the autoscaling achieved nothing. The reverse matters too: after the evening peak, half the nodes may host a few stragglers each, and you pay for all of them.
Node autoscalers close that loop. There are two common ones, the Cluster Autoscaler (CA), part of SIG Autoscaling since 2016, and Karpenter, started at AWS and now also a SIG Autoscaling project, with providers for AWS, Azure, GCP, Cluster API and others.
The signal: Pods the scheduler couldn’t place
Neither one watches CPU graphs. They watch for Pods the scheduler failed to place. On a lab cluster with two 4-CPU fake nodes, a Deployment of three Pods requesting 3 CPU each left one behind:
batch-5cdf5fbf49-6fjmm 0/1 Pending 0 8s <none> fake-1
batch-5cdf5fbf49-9c9mm 0/1 Pending 0 8s <none> fake-2
batch-5cdf5fbf49-cd2bt 0/1 Pending 0 8s <none> <none>
{"type":"PodScheduled","status":"False","reason":"Unschedulable",
"message":"0/2 nodes are available: 2 Insufficient cpu. preemption: 0/2 nodes are available: 2 No preemption victims found for incoming pod."}
(All three show Pending because no kubelet runs containers here. The first two are bound to nodes. The third has none.) PodScheduled=False with reason Unschedulable is the trigger both autoscalers look for. When I then registered a third node, standing in for what an autoscaler would launch, the scheduler bound the Pod within seconds: Successfully assigned default/batch-5cdf5fbf49-cd2bt to fake-3.
The consequence catches many teams out: requests drive node autoscaling, not usage. Pods that request 2 CPU and use 200m fill nodes on paper, and the autoscaler buys more nodes for capacity nobody uses.
How the Cluster Autoscaler scales up
CA works with node groups: AWS Auto Scaling groups, GKE node pools, Azure VM scale sets, each a set of identical machines with a min and max size. Every 10 seconds (--scan-interval) it:
- lists unschedulable Pods;
- for each node group, builds a template node and runs the scheduler’s own filtering code against it to see which Pods would fit;
- if several groups could help, picks one with an expander:
least-waste(the default: least idle CPU after scale-up),most-pods,least-nodes,price,priorityorrandom; - raises that group’s desired size through the cloud API, and waits for the new node to register.
Because CA reuses scheduler code, it respects affinities, taints, topology spread and volume zones. Its limit is the node groups themselves. If no group’s machine shape fits the Pod, a 64 GiB Pod and 32 GiB groups say, CA can’t help, and you maintain a group per shape you need.
How the Cluster Autoscaler scales down
Every scan, if no scale-up is needed, CA looks for unneeded nodes. From its FAQ, a node is a candidate when the requests of its Pods are under 50% of allocatable (--scale-down-utilization-threshold), and every Pod on it could be placed elsewhere. After a node has been unneeded for 10 minutes (--scale-down-unneeded-time), and no scale-up happened in the last 10 minutes, CA taints it, evicts its Pods through the eviction API, so PodDisruptionBudgets are honoured, and deletes the instance. Non-empty nodes go one at a time. Empty ones go in bulk.
Pods that block scale-down: Pods with no controller (nothing would recreate them), Pods using local storage, Pods whose PDB allows no more disruptions, kube-system Pods without a PDB, and anything annotated cluster-autoscaler.kubernetes.io/safe-to-evict: "false".
Karpenter: no node groups
Karpenter skips the middle layer. Instead of resizing groups of fixed machines, it reads the pending Pods’ requirements and launches instances directly. You describe what is allowed in a NodePool:
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: general
spec:
template:
spec:
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
- key: kubernetes.io/arch
operator: In
values: ["amd64", "arm64"]
expireAfter: 720h
limits:
cpu: "200"
disruption:
consolidateAfter: 1m
When Pods are pending, Karpenter batches them, works out which instance types satisfy their combined requests and constraints within those requirements, and creates a NodeClaim that its cloud provider turns into a right-sized instance, often the cheapest spot type that fits. The provider-specific settings, such as AMI, subnets and security groups on AWS, live in the node class (EC2NodeClass). limits caps the total the pool can launch.
I installed Karpenter v1.15.1’s NodePool and NodeClaim CRDs into the lab API server and applied that NodePool. The API server filled in the defaults from the CRD schema:
{"budgets":[{"nodes":"10%"}],"consolidateAfter":"1m","consolidationPolicy":"WhenEmptyOrUnderutilized"}
A misspelt policy was rejected by the schema: Unsupported value: "WhenIdle": supported values: "WhenEmpty", "WhenEmptyOrUnderutilized", "Balanced".
Consolidation, drift and expiry
Karpenter’s disruption controller keeps reshaping the fleet:
- Consolidation: with
WhenEmptyOrUnderutilized, it deletes a node whose Pods fit elsewhere, or replaces several underused nodes with one cheaper node, after nodes have been stable forconsolidateAfter. - Drift: when a node no longer matches its NodePool or node class (say, you changed the AMI), it is replaced.
- Expiry: nodes older than
expireAfterare replaced, which keeps machines patched.
Disruption budgets limit how much happens at once (10% of nodes by default) and can be scheduled, for example zero during business hours. Pods annotated karpenter.sh/do-not-disrupt: "true" keep their node from being voluntarily disrupted. PDBs are respected through eviction.
Choosing
- Cluster Autoscaler works on any cloud with node groups, and it is what GKE’s and many other managed node autoscalers are built on. Predictable, conservative, and limited by the shapes you pre-define.
- Karpenter suits clusters with varied workloads and heavy spot use, where picking the instance type per batch saves real money. It is native on AWS and has providers for Azure, GCP and Cluster API, among others. Managed modes such as EKS Auto Mode and AKS node auto-provisioning are built on it.
Either way, set requests honestly, give every important workload a PDB, and expect nodes to come and go.
About the video
The embed is Sharmio’s “Karpenter vs. Cluster Autoscaler: A Complete Comparison & Explanation”, December 2024, 27 minutes. Its chapters cover Kubernetes architecture, Cluster Autoscaler basics, the limitations of CA, an introduction to Karpenter, and best practices and risks, the same order as this lesson. It was published after Karpenter’s v1 API, though Karpenter has since added the Balanced policy and moved past v1.15. It is AWS-focused and a small channel. I judged it from chapters and description only, since transcripts couldn’t be fetched. English was judged from the title, description and English caption track. The page shows no audio-language flag. Carlos Santana’s 2026 session in deeper goes deep on Karpenter’s three CRDs.
What was run: the Unschedulable condition, the FailedScheduling message and the scheduling onto a newly registered node are real output from a local Kubernetes v1.37.3 control plane whose nodes run no containers. The NodePool defaults and the rejection came from Karpenter v1.15.1’s CRDs installed into that API server. No Cluster Autoscaler or Karpenter controller ran, and no cloud was involved. CA behaviour and defaults are from the Cluster Autoscaler FAQ, Karpenter’s from its docs and nodepool.go, checked 2026-11-28.
Where this fits
That closes health and autoscaling. The next group starts with who is allowed to do any of this: authentication, users and service accounts.
Check yourself
Your nodes run at 15% CPU usage but the Cluster Autoscaler keeps adding nodes. How can both be true?
Autoscalers and the scheduler work from requests, not usage. If Pods request far more than they use, nodes fill up on paper, new Pods go Unschedulable, and the autoscaler adds nodes. Right-size requests (VPA in Off mode helps) to fix it.
What exactly triggers a Cluster Autoscaler scale-up?
A Pod with PodScheduled=False and reason Unschedulable that would fit on a new node from one of the node groups, according to CA's scheduler simulation. If no group's template could fit it, CA does nothing.
A node is 20% utilized by requests but the Cluster Autoscaler won't remove it. What are two possible reasons?
Any of: a Pod with no controller, a Pod using local storage, a PDB that would be violated, a safe-to-evict false annotation, a Pod that fits nowhere else, the node having been added less than 10 minutes ago, or the node not yet unneeded for 10 minutes.
What does Karpenter do differently from the Cluster Autoscaler when Pods are pending?
It batches pending Pods, works out what instance types could satisfy their combined requests and constraints within the NodePool's requirements, and launches a right-sized instance directly through the cloud API. CA can only grow a pre-defined node group of fixed shape.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.