Native ODCR support is a Beta feature. The
ReservedCapacity feature gate is enabled by default as of Karpenter v1.6.If you were using open ODCRs with an earlier version of Karpenter, review the migration section before enabling this feature.What are ODCRs and Capacity Blocks?
On-Demand Capacity Reservations (ODCRs) let you reserve EC2 instance capacity in a specific Availability Zone for any duration. Reserved capacity is available immediately when you need it — you are billed for the reserved capacity whether or not instances are running in it. Capacity Blocks for ML are time-bounded reservations designed for large-scale ML training and inference workloads. Unlike standard ODCRs, Capacity Blocks have a defined end time, after which EC2 reclaims the instances. Karpenter models capacity reservations as a distinct capacity type (reserved) separate from on-demand and spot. This lets you express prioritization in NodePool requirements.
Enabling native ODCR support
Ensure theReservedCapacity feature gate is enabled. As of v1.6 this is on by default. For earlier versions, enable it explicitly in your Karpenter configuration.
Configuring capacity reservation selector terms
AddcapacityReservationSelectorTerms to your EC2NodeClass. This works similarly to amiSelectorTerms — you specify one or more terms, and Karpenter selects matching reservations in your AWS account.
Capacity Blocks are modeled as on-demand capacity reservations in EC2. Select them using the same
capacityReservationSelectorTerms you use for standard ODCRs.Configuring the NodePool
Karpenter uses a dedicated capacity type value,reserved, for capacity reservations. Update your NodePool to include reserved in the karpenter.sh/capacity-type requirement.
Prioritize reservations, fall back to on-demand
Prioritize reservations, fall back to Spot or on-demand
reserved capacity first. Because ODCRs are pre-paid, Karpenter models them as free and will consolidate Spot and on-demand nodes onto reserved capacity when possible.
Scheduling labels for reserved nodes
Nodes launched into a capacity reservation carry additional labels you can use for scheduling constraints:| Label | Example value | Description |
|---|---|---|
karpenter.k8s.aws/capacity-reservation-id | cr-56fac701cc1951b03 | The reservation’s ID |
karpenter.k8s.aws/capacity-reservation-type | default or capacity-block | The type of reservation |
reserved nodes. Use them in NodePool requirements or pod scheduling constraints (e.g. node affinity):
Prioritization behavior
When a NodePool is compatible with multiple capacity types, Karpenter uses the following priority order:- Reserved — used first if available and compatible with pending workloads
- Spot — used if no compatible reservations are available
- On-demand — used as final fallback
Expiration and capacity block reclamation
ODCRs
An instance launched into an ODCR is not guaranteed to remain in that reservation indefinitely. The ODCR can expire, be cancelled, or the instance can be manually removed from it. If Karpenter detects that an instance is no longer associated with a reservation, it updates the node’skarpenter.sh/capacity-type label from reserved to on-demand.
Capacity Blocks
Capacity Blocks always have an end time. EC2 terminates instances in a Capacity Block before the end time:- For standard instance types: 30 minutes before expiry
- For UltraServer instance types: 60 minutes before expiry
Combining capacity types
NodePools can mix all three capacity types to express flexible fallback behavior:weight values to express explicit preference ordering across pools.
Migrating from previous versions
Before native ODCR support (prior to v1.3), Karpenter could incidentally launch instances intoopen ODCRs if a NodeClaim’s requirements happened to match an open reservation. This behavior is no longer supported when the ReservedCapacity feature gate is enabled.
If you relied on this implicit behavior:
Add capacityReservationSelectorTerms to your EC2NodeClass
Explicitly list the reservations you want Karpenter to use before enabling the feature gate.
Update NodePool capacity-type requirements
Add
reserved to any NodePools you want to use with your ODCRs.EC2NodeClass and NodePool updates before enabling the feature gate ensures Karpenter can continue using your reservations without a gap in coverage.