Skip to content

Commit bc7e13f

Browse files
committed
docs: reserved capacity updates
1 parent 059d85e commit bc7e13f

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

website/content/en/preview/concepts/nodeclasses.md

+55-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ spec:
110110
# exclusive and can't be specified with other terms.
111111
# - alias: al2023@v20240703
112112

113+
# Optional, each term in the array of capacityReservationSelectorTerms is ORed together.
114+
capacityReservationSelectorTerms:
115+
- tags:
116+
karpenter.sh/discovery: ${CLUSTER_NAME}
117+
- id: cr-123
118+
113119
# Optional, propagates tags to underlying EC2 resources
114120
tags:
115121
team: team-a
@@ -430,7 +436,7 @@ spec:
430436
### AL2
431437

432438
{{% alert title="AL2 support dropped at Kubernetes 1.33" color="warning" %}}
433-
Kubernetes version 1.32 is the last version for which Amazon EKS will release Amazon Linux 2 (AL2) AMIs.
439+
Kubernetes version 1.32 is the last version for which Amazon EKS will release Amazon Linux 2 (AL2) AMIs.
434440
{{% /alert %}}
435441

436442
{{% alert title="Note" color="primary" %}}
@@ -846,6 +852,54 @@ Specify using ids:
846852
- id: "ami-456"
847853
```
848854

855+
## spec.capacityReservationSelectorTerms
856+
857+
Capacity Reservation Selector Terms allow you to select [on-demand capacity reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html), which will be made available to NodePools which select the given EC2NodeClass.
858+
Karpenter will prioritize utilizing the capacity in these reservations before falling back to on-demand and spot.
859+
Capacity reservations can be discovered using ids or tags.
860+
861+
This selection logic is modeled as terms.
862+
A term can specify an ID or a set of tags to select against.
863+
When specifying tags, it will select all capacity reservations accessible from the account with matching tags.
864+
This can be further restricted by specifying an owner ID.
865+
866+
#### Examples
867+
868+
Select the reservations with the given IDs:
869+
870+
```yaml
871+
spec:
872+
capacityReservationSelectorTerms:
873+
- id: cr-123
874+
- id: cr-456
875+
```
876+
877+
Select the reservations by tags:
878+
879+
```yaml
880+
spec:
881+
capacityReservationSelectorTerms:
882+
# Select all capacity reservations which have both matching tags
883+
- tags:
884+
key1: foo
885+
key2: bar
886+
# Additionally, select all capacity reservations with the following matching tag
887+
- tags:
888+
key3: foobar
889+
```
890+
891+
Select by tags and owner ID:
892+
893+
```yaml
894+
spec:
895+
# Select all capacity reservations with the matching tags which are also owned by
896+
# the specified account.
897+
capacityReservationSelectorTerms:
898+
- tags:
899+
key: foo
900+
ownerID: 012345678901
901+
```
902+
849903
## spec.tags
850904

851905
Karpenter adds tags to all resources it creates, including EC2 Instances, EBS volumes, and Launch Templates. The default set of tags are listed below.

website/content/en/preview/concepts/nodepools.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spec:
115115
values: ["arm64", "amd64"]
116116
- key: "karpenter.sh/capacity-type"
117117
operator: In
118-
values: ["spot", "on-demand"]
118+
values: ["spot", "on-demand", "reserved"]
119119

120120
# Disruption section which describes the ways in which Karpenter can disrupt and replace Nodes
121121
# Configuration in this section constrains how aggressive Karpenter can be with performing operations
@@ -251,12 +251,13 @@ Karpenter supports `linux` and `windows` operating systems.
251251
- values
252252
- `spot`
253253
- `on-demand`
254+
- `reserved`
254255

255256
Karpenter supports specifying capacity type, which is analogous to [EC2 purchase options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html).
256257

257-
Karpenter prioritizes Spot offerings if the NodePool allows Spot and on-demand instances (note that in this scenario any Spot instances priced higher than the cheapest on-demand instance will be temporarily removed from consideration).
258-
If the provider API (e.g. EC2 Fleet's API) indicates Spot capacity is unavailable, Karpenter caches that result across all attempts to provision EC2 capacity for that instance type and zone for the next 3 minutes.
259-
If there are no other possible offerings available for Spot, Karpenter will attempt to provision on-demand instances, generally within milliseconds.
258+
If a NodePool is compatible with multiple capacity types, Karpenter will prioritize `reserved` capacity, followed by `spot`, then finally `on-demand`.
259+
If the provider API (e.g. EC2 Fleet's API) indicates capacity is unavailable, Karpenter caches that result across all attempts to provision EC2 capacity for that instance type and zone for the next 3 minutes.
260+
If there are no other possible offerings available for a higher priority capacity type, Karpenter will attempt to fallback to a lower priority capacity type, generally within milliseconds.
260261

261262
Karpenter also allows `karpenter.sh/capacity-type` to be used as a topology key for enforcing topology-spread.
262263

website/content/en/preview/concepts/scheduling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Take care to ensure the label domains are correct. A well known label like `karp
154154
| node.kubernetes.io/windows-build | 10.0.17763 | Windows OS build in the format "MajorVersion.MinorVersion.BuildNumber". Can be `10.0.17763` for WS2019, or `10.0.20348` for WS2022. ([k8s](https://kubernetes.io/docs/reference/labels-annotations-taints/#nodekubernetesiowindows-build)) |
155155
| kubernetes.io/os | linux | Operating systems are defined by [GOOS values](https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go) (`KnownOS`) on the instance |
156156
| kubernetes.io/arch | amd64 | Architectures are defined by [GOARCH values](https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go) (`KnownArch`) on the instance |
157-
| karpenter.sh/capacity-type | spot | Capacity types include `spot`, `on-demand` |
157+
| karpenter.sh/capacity-type | spot | Capacity types include `reserved`, `spot`, and `on-demand` |
158158
| karpenter.k8s.aws/instance-hypervisor | nitro | [AWS Specific] Instance types that use a specific hypervisor |
159159
| karpenter.k8s.aws/instance-encryption-in-transit-supported | true | [AWS Specific] Instance types that support (or not) in-transit encryption |
160160
| karpenter.k8s.aws/instance-category | g | [AWS Specific] Instance types of the same category, usually the string before the generation number |

0 commit comments

Comments
 (0)