,

What Is Karpenter? How Just-in-Time Node Provisioning Cuts Kubernetes Cost

Karpenter provisions Kubernetes nodes from unschedulable pods and manages capacity as demand changes. Learn the controller flow, NodePool and NodeClaim roles, consolidation controls, and common failure modes.

what is karpenter featured image

Karpenter is an open-source Kubernetes node provisioner that creates capacity for pods the scheduler cannot place. It evaluates pod requirements against NodePool constraints and asks the cloud provider to launch suitable nodes. Its node lifecycle controls can also remove or replace capacity as demand changes. AWS announced Karpenter 1.0 on August 14, 2024; the examples below use the v1 API and were checked against Karpenter v1.15 documentation.

Key takeaways

  • Karpenter watches unschedulable pods and provisions right-sized nodes directly from cloud APIs, without pre-defined node groups.
  • Two key configuration resources define behavior: NodePool (scheduling constraints and disruption policy) and NodeClass (cloud infrastructure configuration).
  • Consolidation removes empty or underutilized nodes by repacking workloads onto fewer machines, reducing idle compute cost.
  • Karpenter can be self-managed on supported providers or used through managed services such as Amazon EKS Auto Mode and Azure AKS Node Auto Provisioning. Provider capabilities differ.
  • Karpenter sizes nodes from pod requests and scheduling constraints; it does not rightsize those requests from observed application usage.

What Karpenter is

The core idea is direct cloud API provisioning. Rather than scaling a predefined node group, Karpenter evaluates compatible capacity for unschedulable pods. On AWS, the provider uses EC2 APIs. The instance choice is constrained by your configuration, availability and purchasing policies; it is not a promise that every pod gets the cheapest possible machine.

Karpenter sits within the broader ecosystem of Kubernetes autoscaling alongside the Horizontal Pod Autoscaler and Vertical Pod Autoscaler. Its focus is the node layer: how many machines run, what size they are, and how quickly they shut down when demand drops.

In โ€œIs Karpenter good enough?โ€, Justin Garrison examines Kubernetes node autoscaling through hands-on examples. He discusses where Karpenter handles initial node provisioning well, explores additional Cast AI consolidation and Spot controls, and highlights live-migration limitations and the need to plan workload capacity and purchasing. His Karpenter walkthrough starts at 15:32. The video is sponsored by Cast AI.

Justin Garrison explains where Karpenterโ€™s node autoscaling helps, how Cast AI adds optimization controls, and the operational trade-offs to consider.

How Karpenter provisions nodes

  1. Observe unschedulable pods. Read the schedulerโ€™s placement constraints and requested resources.
  2. Find compatible capacity. Match those requirements to NodePool rules and provider-specific NodeClass configuration.
  3. Create NodeClaims. Request the required capacity from the cloud provider; on AWS, the provider calls EC2 APIs.
  4. Wait for readiness. The instance must launch and the node register and initialize. The Kubernetes scheduler can then place the pods, which must start and pass application readiness checks.
  5. Reassess capacity. Consolidation and other lifecycle controls later remove or replace nodes when policy and disruption constraints permit.

The NodeClaim lifecycle separates launch, registration and initialization, so it also gives you a practical way to locate a failed provisioning step.

Watching pending pods

Karpenter watches for pods marked unschedulable by Kubernetes. It evaluates resource requests, selectors, taints and tolerations, affinity and topology constraints against compatible NodePools. A pending pod caused by an image or application error does not necessarily need another node.

Instance selection across families and sizes

Karpenter can consider a broad set of instance families and sizes, but only within your NodePool and provider constraints. Resource requests, daemon overhead, architecture and zone requirements all affect which nodes fit. On AWS, Spot allocation considers both capacity availability and price; the smallest instance is not always selected. See the upstream scheduling model.

The result is smarter bin-packing from the start. Karpenter sizes nodes to fit the workload, not the other way around.

Just-in-time vs node groups

Traditional node group autoscaling requires you to define instance types and group sizes upfront. The autoscaler scales those groups. As a result, you frequently end up with nodes too large for what is actually running on them.

Karpenter has no node groups. It provisions nodes just in time, selecting the right instance for each scheduling event. It also deprovisions nodes when workloads no longer need them. The lifecycle is tighter, and idle compute costs less.

Consolidation and bin-packing

How it removes and repacks nodes for cost

Consolidation evaluates whether a node can be removed or replaced while satisfying scheduling constraints. When replacement capacity is required, Karpenter normally prepares it before draining the candidate. Disruption controls can delay or block the operation.

The supported consolidation policies are WhenEmpty and WhenEmptyOrUnderutilized. The latter permits removal or replacement when workloads can run on suitable remaining or cheaper replacement capacity. consolidateAfter and disruption budgets control timing and pace. There is no Balanced consolidation policy in the Karpenter v1.15 NodePool API. See Karpenter disruption documentation.

Reducing node waste and reducing inflated pod requests are separate tasks. Karpenter treats requested CPU and memory as scheduling requirements even when usage is lower.

Disruption controls

NodePool disruption budgets limit voluntary disruption. consolidateAfter sets how long Karpenter waits after a pod is added to or removed from a node before considering consolidation. Use it with either supported consolidation policy to avoid responding too aggressively to workload churn.

The budgets array gives you fine-grained control over the pace of disruption:

disruption:
  budgets:
    - nodes: "10%"
    - nodes: "5"
      schedule: "@daily"
      duration: 1h

These budgets apply to this NodePool, not the entire fleet. The most restrictive active budget applies. The 10% limit remains active all day; the five-node limit adds a restriction for one hour starting at midnight UTC each day. This does not create an exclusive maintenance window. Deleting and NotReady nodes also affect the allowed disruption count.

For voluntary consolidation, Karpenter uses the eviction API and respects PodDisruptionBudgets. Budgets are not protection against all failure modes: cloud interruptions cannot be postponed by a PDB, and forceful lifecycle actions have different rules. Review expiration and termination grace settings alongside voluntary disruption controls.

For in-depth guidance on safe consolidation configuration, see our Karpenter consolidation guide. For a detailed look at disruption and drift interactions, see Karpenter disruption and drift.

Core concepts

NodePools and NodeClasses

Karpenter uses NodePools and provider-specific NodeClasses to define desired capacity; NodeClaims track the nodes it creates. A NodePool sets scheduling constraints (architecture, capacity type, instance family), resource limits, and disruption policy. A NodeClass sets cloud-provider infrastructure configuration. On AWS, this is an EC2NodeClass, specifying AMI selection, subnets, security groups, and IAM role.

The separation is intentional. Platform teams own the NodeClass for cloud configuration. Individual teams can define their own NodePool constraints for their workloads. This design keeps infrastructure policy centralized and workload scheduling policy flexible.

A minimal NodePool YAML example

The following NodePool permits on-demand and Spot capacity on amd64, sets a 1,000-CPU limit for this NodePool, and enables WhenEmptyOrUnderutilized consolidation with a 10% disruption budget. Supply an EC2NodeClass appropriate to your cluster; this is a configuration example, not a complete installation.

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: default
spec:
  template:
    spec:
      requirements:
        - key: kubernetes.io/arch
          operator: In
          values: ["amd64"]
        - key: karpenter.sh/capacity-type
          operator: In
          values: ["on-demand", "spot"]
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: default
  limits:
    cpu: "1000"
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 1m
    budgets:
      - nodes: "10%"

The paired EC2NodeClass supplies the AMI, IAM role, subnet and security-group selectors. Replace the example names with your own. The al2023@latest alias follows newly released AMIs; for controlled production rollouts, select and test a pinned AMI version instead.

apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
  name: default
spec:
  amiSelectorTerms:
    - alias: al2023@latest
  role: "KarpenterNodeRole-my-cluster"
  subnetSelectorTerms:
    - tags:
        karpenter.sh/discovery: "my-cluster"
  securityGroupSelectorTerms:
    - tags:
        karpenter.sh/discovery: "my-cluster"

For a full breakdown of every NodePool and NodeClass field, see the Karpenter NodePools guide.

Disruption and drift

Drift identifies nodes whose configuration no longer matches relevant desired settings in their NodePool or NodeClass, such as a changed AMI. Replacement still depends on the applicable disruption controls and scheduling requirements; a detected change does not guarantee immediate replacement.

How fast does Karpenter provision nodes?

There is no universal end-to-end provisioning time. For Karpenter v1.15, distinguish the controllerโ€™s provisioning decision from EC2 launch, node initialization, image pulls and application readiness. Instance availability, AMIs, networking, storage and startup probes can all change the result. Measure pending-pod-to-ready-application latency in your own cluster; a short controller log duration is not a ready-node benchmark.

Karpenter vs Cluster Autoscaler

Cluster Autoscaler adjusts the size of configured node groups. Karpenter selects and provisions nodes using pod requirements and NodePool rules, with the provider controlling which instance options are available.

Both approaches depend on cloud capacity, node startup and application readiness. Avoid treating a controller reaction time as an end-to-end provisioning guarantee. Compare the time from an unschedulable pod to a ready application under the same workload and configuration.

Provider support and operational requirements determine which approach fits. Check the maintained integrations for your environment and compare their controls using the Karpenter vs Cluster Autoscaler guide.

Common Karpenter failure modes

  • Pods stay unschedulable: check NodePool limits and compatibility with selectors, architecture, zones, taints and resource requests.
  • A NodeClaim does not launch: inspect events for permissions, quotas, missing subnets or unavailable capacity.
  • A node launches but is not ready: check bootstrap, networking, startup taints and device or storage initialization.
  • Consolidation stalls: inspect PDBs, disruption budgets, scheduling constraints and non-evictable pods before loosening safeguards.
  • Nodes consolidate but costs remain high: inspect inflated pod requests and other cost drivers using the Karpenter cost diagnostic checklist.

Start with pod events and NodeClaim conditions, then use the upstream troubleshooting guide. Resolve the failing stage rather than simply adding more instance types.

Karpenter on EKS and beyond

On Amazon EKS, you can self-manage Karpenter or use the managed compute capabilities of EKS Auto Mode. These are different operational models: Auto Mode manages more of the node lifecycle for you. See our EKS Auto Mode guide.

Azure AKS offers Node Auto Provisioning, which manages Karpenter and the AKS provider. Its prerequisites and supported configuration differ from the AWS provider.

For another cloud or Kubernetes distribution, verify that a maintained provider supports your requirements. Do not assume AWS NodeClass configuration or managed-service behaviour transfers unchanged. On GKE, evaluate Googleโ€™s supported node autoscaling options against the operational model you need.

Where Karpenter stops and automation helps

Karpenter is effective at node provisioning and consolidation. Nevertheless, three gaps limit what it can achieve on its own.

The most common gap is over-requested pods. If a container requests 4 CPUs but uses 0.3, Karpenter still provisions a node sized to accommodate the full request. That gap โ€” between what pods claim and what they actually consume โ€” is a pod-request problem, not a node-provisioning problem.

Stateful workloads face a different constraint. When Karpenter consolidates, it evicts pods. For stateless workloads that tolerate disruption, this works well. For stateful workloads with persistent connections or local storage, eviction can mean downtime.

Spot instance risk is the third boundary. Karpenter handles interruption signals reactively but has no ML-based prediction of which Spot instances the cloud provider will reclaim.

Cast AI for Karpenter adds workload rightsizing, cost visibility and additional optimization controls alongside Karpenter on supported EKS and AKS deployments. Container live migration applies only to eligible workloads and is not a guarantee against Spot interruption. Validate platform and workload requirements before enabling each feature.

Karpenter provisions and manages nodes, while workload rightsizing adjusts application requests. Lower requests produce infrastructure savings only when capacity can actually be removed or replaced.

Cast AI demo simulation comparing used, requested and provisioned CPU before and after workload rightsizing and node optimization.
Cast AI demo simulation on GKE: CPU requests decrease after workload rightsizing, followed by lower provisioned capacity after node optimization. This illustrates workload sizing versus node capacity; it is not a Karpenter benchmark or a measured customer result. Select the image to view it at full size.

Frequently Asked Questions

What is Karpenter?

Karpenter is an open-source Kubernetes node provisioner. It evaluates unschedulable pods and creates compatible cloud capacity without predefined node groups. It also manages node disruption and consolidation. Karpenter 1.0 was announced in August 2024.

How does Karpenter work?

It matches pod requests and scheduling constraints to NodePools and NodeClasses, creates NodeClaims and asks the provider to launch capacity. The node must register and initialize before Kubernetes can place workloads on it.

Is Karpenter only for AWS?

No. AWS and Azure have Karpenter providers, and managed offerings include EKS Auto Mode and AKS Node Auto Provisioning. Verify provider-specific prerequisites and capabilities before choosing a deployment model.

How does Karpenter reduce cost?

It can reduce idle node capacity by choosing compatible instance types and consolidating removable or replaceable nodes. It does not lower inflated pod resource requests automatically, and it does not guarantee a fixed savings percentage.

What is consolidation in Karpenter?

Consolidation evaluates whether nodes can be removed or replaced at lower cost while satisfying scheduling and disruption constraints. The v1.15 policies are WhenEmpty and WhenEmptyOrUnderutilized; there is no Balanced policy.

Karpenter vs Cluster Autoscaler: what is the difference?

Cluster Autoscaler scales configured node groups. Karpenter provisions individual nodes using workload requirements and NodePool constraints. Provider support and operational requirements determine which approach fits; neither has a universal provisioning-time advantage.

Update summary: Clarified the Karpenter v1.15 provisioning flow, consolidation controls and common failure modes.

Cast AI โ€บ Blog โ€บ What Is Karpenter? How Just-in-Time Node Provisioning Cuts Kubernetes Cost