Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 34/ 160
02. Workload Controllers & Scaling

Cluster Autoscaler vs Karpenter (Dynamic Node Provisioning)

Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning.

AdvancedCluster Autoscaler · Karpenter · Nodes3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Cluster Autoscaler adds another pre-sized bus, while Karpenter dispatches a vehicle chosen from the current passenger list. The simple Kubernetes rule is: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Think of it like…

Cluster Autoscaler adds another pre-sized bus, while Karpenter dispatches a vehicle chosen from the current passenger list.

Where you’ve seen it

During a release or scale event, the workload owner runs kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler. Expected evidence: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints. If the run instead shows this symptom, stop and restore the last known state: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.

Words you’ll hear

Cluster Autoscaler
For this lesson, Cluster Autoscaler is the controlling idea: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
Karpenter
Karpenter is the checkpoint; run kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler and inspect the owner chain. An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.
Nodes
Nodes is the outcome to preserve; the cost is explicit: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.
Verification evidence
The evidence command is kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler. It connects the declaration to this behavior: Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning.

Visual diagram

Loading interactive diagram

Theory & deep dive

How Cluster Autoscaler reaches the intended state

Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning. Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

The concrete checkpoint is kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler; compare the Cluster Autoscaler owner, Karpenter state, and Nodes outcome instead of treating YAML acceptance as proof.

Verify Karpenter, not only object creation

Run kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler after the change and correlate the result with Events and the owning object. Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Key takeaway: Cluster Autoscaler is implemented only when this invariant remains observable: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Karpenter: failure boundary and production cost

An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them. The prerequisite contract is concrete: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity. A safe design limits blast radius, records the last good configuration, and uses kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler as a deterministic rollback checkpoint.

Recover from Karpenter drift

Capture the current state with kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.

Key takeaway: Accept the trade-off consciously: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

How it works, step by step

Step 1 of 4
Workload author

1. Declare workload intent

Write the controller-owned Pod or scaling intent and preserve the owner chain: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Cluster Autoscaler contract → owned state
Key numbers at this step
Goal
Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning.
Owner
Cluster Autoscaler

When to use it & trade-offs

What it is

Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning. Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Why it matters: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them. The invariant at risk is specific: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints. The quickest fact check before changing the design is kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler.

When to reach for it

  • Use Cluster Autoscaler to enforce this invariant: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
  • Use Karpenter evidence from kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler in reviews and incident timelines. Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning.
  • Choose the progressive-delivery layer route only when this cost is justified by governance or scale: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

When to avoid or be careful

  • Avoid assuming Cluster Autoscaler is complete after YAML submission; the required behavior is concrete: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
  • Avoid treating the next symptom as random; check the owner and state with kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler first: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.
  • Avoid adopting a heavier platform wrapper before measuring its cost: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

Native, manual, and managed paths for Cluster Autoscaler

Controller-managed workload
Best for: Compare classic Cluster Autoscaler with Karpenter-style just-in-time node provisioning. A concrete incident check is kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler.

Strengths: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Watch out: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity. Recovery must also recognize this signal: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.

Hand-managed Pods
Best for: Quickly testing the Karpenter assumption with kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler; the expected invariant is: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Strengths: kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike Cluster Autoscaler, it does not make this symptom self-documenting: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.

Progressive-delivery layer
Best for: Teams that need Nodes integrated with guardrails; the evidence path is kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.

Watch out: The added platform ownership buys value at this cost: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
  • Trace Cluster Autoscaler to Nodes through Karpenter; the invariant is: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
  • Recognize the symptom: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.
  • Justify the cost: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.
  • Verify with kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler instead of only inspecting YAML.

Benchmarks & rules of thumb

1 -
Pending Pod with no eligible node can trigger provisioning
0 -
new nodes help before the control loop completes
2 -
different domains to verify: scheduling eligibility and provider capacity

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the Cluster Autoscaler owner contract: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints.
  • Ignoring this telltale condition leads to unrelated changes: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them.
  • Repeating kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler without an owner for remediation wastes retry cost. Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints?
  • Which owner object, logs, and Events would you inspect for this symptom-An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them-?
  • At what threshold would this cost become unacceptable: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity?
Interview tip: Interview sequence: state the invariant, run kubectl get pods --field-selector=status.phase=Pending; kubectl logs -n kube-system deploy/cluster-autoscaler, name the failure, then justify the cost. Invariant: Cluster Autoscaler reacts to unschedulable Pods through node-group heuristics, while Karpenter-style provisioners can select just-in-time instance shapes from Pod constraints. Failure: An absent daemon capacity budget, strict topology, no matching instance type, or interrupted spot pool can leave Pods pending while the autoscaler repeatedly evaluates them. Cost: Group-based scaling is simple to operate, but right-sizing each node can reduce waste; dynamic provisioning increases instance, disruption, and consolidation complexity.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Cluster Autoscaler vs Karpenter (Dynamic Node Provisioning) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Vertical Pod Autoscaler (VPA) & In-Place Pod Vertical Scaling
Next topic
Pod Disruption Budgets (PDBs) for Safe Node Maintenance