Skip to content

Commit 6f0dc13

Browse files
committed
Update to Karpenter v1.8.0
https://github.com/kubernetes-sigs/karpenter/releases/tag/v1.8.0 Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
1 parent bc06d6a commit 6f0dc13

File tree

3 files changed

+56
-8
lines changed

3 files changed

+56
-8
lines changed

cluster/manifests/z-karpenter/07-karpenter.k8s.aws_ec2nodeclasses.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ spec:
262262
description: ID is the capacity reservation id in EC2
263263
pattern: ^cr-[0-9a-z]+$
264264
type: string
265+
instanceMatchCriteria:
266+
description: InstanceMatchCriteria specifies how instances are matched to capacity reservations.
267+
enum:
268+
- open
269+
- targeted
270+
type: string
265271
ownerID:
266272
description: Owner is the owner id for the ami.
267273
pattern: ^[0-9]{12}$
@@ -281,10 +287,10 @@ spec:
281287
maxItems: 30
282288
type: array
283289
x-kubernetes-validations:
284-
- message: expected at least one, got none, ['tags', 'id']
285-
rule: self.all(x, has(x.tags) || has(x.id))
286-
- message: '''id'' is mutually exclusive, cannot be set along with tags in a capacity reservation selector term'
287-
rule: '!self.all(x, has(x.id) && (has(x.tags) || has(x.ownerID)))'
290+
- message: expected at least one, got none, ['tags', 'id', 'instanceMatchCriteria']
291+
rule: self.all(x, has(x.tags) || has(x.id) || has(x.instanceMatchCriteria))
292+
- message: '''id'' is mutually exclusive, cannot be set along with other fields in a capacity reservation selector term'
293+
rule: '!self.all(x, has(x.id) && (has(x.tags) || has(x.ownerID) || has(x.instanceMatchCriteria)))'
288294
context:
289295
description: |-
290296
Context is a Reserved field in EC2 APIs
@@ -308,6 +314,11 @@ spec:
308314
enum:
309315
- RAID0
310316
type: string
317+
ipPrefixCount:
318+
description: IPPrefixCount sets the number of IPv4 prefixes to be automatically assigned to the network interface.
319+
format: int32
320+
minimum: 0
321+
type: integer
311322
kubelet:
312323
description: |-
313324
Kubelet defines args to be used when configuring kubelet on provisioned nodes.

cluster/manifests/z-karpenter/09-karpenter.sh_nodepools.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- jsonPath: .spec.template.spec.nodeClassRef.name
2121
name: NodeClass
2222
type: string
23-
- jsonPath: .status.resources.nodes
23+
- jsonPath: .status.nodes
2424
name: Nodes
2525
type: string
2626
- jsonPath: .status.conditions[?(@.type=="Ready")].status
@@ -122,6 +122,7 @@ spec:
122122
- Empty
123123
- Drifted
124124
type: string
125+
maxItems: 50
125126
type: array
126127
schedule:
127128
description: |-
@@ -144,13 +145,15 @@ spec:
144145
ConsolidateAfter is the duration the controller will wait
145146
before attempting to terminate nodes that are underutilized.
146147
Refer to ConsolidationPolicy for how underutilization is considered.
148+
When replicas is set, ConsolidateAfter is simply ignored
147149
pattern: ^(([0-9]+(s|m|h))+|Never)$
148150
type: string
149151
consolidationPolicy:
150152
default: WhenEmptyOrUnderutilized
151153
description: |-
152154
ConsolidationPolicy describes which nodes Karpenter can disrupt through its consolidation
153155
algorithm. This policy defaults to "WhenEmptyOrUnderutilized" if not specified
156+
When replicas is set, ConsolidationPolicy is simply ignored
154157
enum:
155158
- WhenEmpty
156159
- WhenEmptyOrUnderutilized
@@ -165,8 +168,24 @@ spec:
165168
- type: string
166169
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
167170
x-kubernetes-int-or-string: true
168-
description: Limits define a set of bounds for provisioning capacity.
171+
description: |-
172+
Limits define a set of bounds for provisioning capacity.
173+
Limits other than limits.nodes is not supported when replicas is set.
169174
type: object
175+
replicas:
176+
description: |-
177+
Replicas is the desired number of nodes for the NodePool. When specified, the NodePool will
178+
maintain this fixed number of replicas rather than scaling based on pod demand.
179+
When replicas is set:
180+
- The following fields are ignored:
181+
* disruption.consolidationPolicy
182+
* disruption.consolidateAfter
183+
- Only limits.nodes is supported; other resource limits (e.g., CPU, memory) must not be specified.
184+
- Weight is not supported.
185+
Note: This field is alpha.
186+
format: int64
187+
minimum: 0
188+
type: integer
170189
template:
171190
description: |-
172191
Template contains the template of possibilities for the provisioning logic to launch a NodeClaim with.
@@ -430,13 +449,21 @@ spec:
430449
numerical weight indicates that this nodepool will be ordered
431450
ahead of other nodepools with lower weights. A nodepool with no weight
432451
will be treated as if it is a nodepool with a weight of 0.
452+
Weight is not supported when replicas is set.
433453
format: int32
434454
maximum: 100
435455
minimum: 1
436456
type: integer
437457
required:
438458
- template
439459
type: object
460+
x-kubernetes-validations:
461+
- message: Cannot transition NodePool between static (replicas set) and dynamic (replicas unset) provisioning modes
462+
rule: has(self.replicas) == has(oldSelf.replicas)
463+
- message: only 'limits.nodes' is supported on static NodePools
464+
rule: '!has(self.replicas) || (!has(self.limits) || size(self.limits) == 0 || (size(self.limits) == 1 && ''nodes'' in self.limits))'
465+
- message: '''weight'' is not supported on static NodePools'
466+
rule: '!has(self.replicas) || !has(self.weight)'
440467
status:
441468
description: NodePoolStatus defines the observed state of NodePool
442469
properties:
@@ -502,6 +529,11 @@ spec:
502529
the actual NodeClass Generation, NodeRegistrationHealthy status condition on the NodePool will be reset
503530
format: int64
504531
type: integer
532+
nodes:
533+
default: 0
534+
description: Nodes is the count of nodes associated with this NodePool
535+
format: int64
536+
type: integer
505537
resources:
506538
additionalProperties:
507539
anyOf:
@@ -518,4 +550,7 @@ spec:
518550
served: true
519551
storage: true
520552
subresources:
553+
scale:
554+
specReplicasPath: .spec.replicas
555+
statusReplicasPath: .status.nodes
521556
status: {}

cluster/manifests/z-karpenter/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
capabilities:
5252
drop:
5353
- ALL
54-
image: "container-registry.zalando.net/teapot/karpenter:1.7.1-main-42.patched"
54+
image: "container-registry-test.zalando.net/teapot/karpenter:1.8.0-pr-45-3.patched"
5555
imagePullPolicy: IfNotPresent
5656
env:
5757
- name: KUBERNETES_MIN_VERSION
@@ -95,7 +95,7 @@ spec:
9595
divisor: "0"
9696
resource: limits.memory
9797
- name: FEATURE_GATES
98-
value: "ReservedCapacity=false,SpotToSpotConsolidation=true,NodeRepair=false,NodeOverlay=false"
98+
value: "ReservedCapacity=true,SpotToSpotConsolidation=true,NodeRepair=false,NodeOverlay=false,StaticCapacity=false"
9999
- name: BATCH_MAX_DURATION
100100
value: "10s"
101101
- name: BATCH_IDLE_DURATION
@@ -110,6 +110,8 @@ spec:
110110
value: "0.075"
111111
- name: RESERVED_ENIS
112112
value: "0"
113+
- name: IGNORE_DRA_REQUESTS
114+
value: "true"
113115
{{ $pod_cidr_size := "15" }}
114116
- name: MAX_NODE_CLAIMS
115117
value: "{{ nodeCIDRMaxNodesPodCIDR (parseInt64 $pod_cidr_size) (parseInt64 .Cluster.ConfigItems.node_cidr_mask_size) (parseInt64 .Cluster.ConfigItems.reserved_nodes) }}"

0 commit comments

Comments
 (0)