Skip to content

Commit deb51f8

Browse files
authored
feat: update karpenter CRDS to match latest release (#727)
1 parent d743169 commit deb51f8

File tree

4 files changed

+338
-71
lines changed

4 files changed

+338
-71
lines changed

karpenter.k8s.aws/ec2nodeclass_v1.json

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@
214214
"pattern": "^cr-[0-9a-z]+$",
215215
"type": "string"
216216
},
217+
"instanceMatchCriteria": {
218+
"description": "InstanceMatchCriteria specifies how instances are matched to capacity reservations.",
219+
"enum": [
220+
"open",
221+
"targeted"
222+
],
223+
"type": "string"
224+
},
217225
"ownerID": {
218226
"description": "Owner is the owner id for the ami.",
219227
"pattern": "^[0-9]{12}$",
@@ -241,12 +249,12 @@
241249
"type": "array",
242250
"x-kubernetes-validations": [
243251
{
244-
"message": "expected at least one, got none, ['tags', 'id']",
245-
"rule": "self.all(x, has(x.tags) || has(x.id))"
252+
"message": "expected at least one, got none, ['tags', 'id', 'instanceMatchCriteria']",
253+
"rule": "self.all(x, has(x.tags) || has(x.id) || has(x.instanceMatchCriteria))"
246254
},
247255
{
248-
"message": "'id' is mutually exclusive, cannot be set along with tags in a capacity reservation selector term",
249-
"rule": "!self.all(x, has(x.id) && (has(x.tags) || has(x.ownerID)))"
256+
"message": "'id' is mutually exclusive, cannot be set along with other fields in a capacity reservation selector term",
257+
"rule": "!self.all(x, has(x.id) && (has(x.tags) || has(x.ownerID) || has(x.instanceMatchCriteria)))"
250258
}
251259
]
252260
},
@@ -275,6 +283,12 @@
275283
],
276284
"type": "string"
277285
},
286+
"ipPrefixCount": {
287+
"description": "IPPrefixCount sets the number of IPv4 prefixes to be automatically assigned to the network interface.",
288+
"format": "int32",
289+
"minimum": 0,
290+
"type": "integer"
291+
},
278292
"kubelet": {
279293
"description": "Kubelet defines args to be used when configuring kubelet on provisioned nodes.\nThey are a subset of the upstream types, recognizing not all options may be supported.\nWherever possible, the types and names should reflect the upstream kubelet types.",
280294
"properties": {
@@ -291,8 +305,8 @@
291305
},
292306
"evictionHard": {
293307
"additionalProperties": {
294-
"pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$",
295-
"type": "string"
308+
"type": "string",
309+
"pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$"
296310
},
297311
"description": "EvictionHard is the map of signal names to quantities that define hard eviction thresholds",
298312
"type": "object",
@@ -310,8 +324,8 @@
310324
},
311325
"evictionSoft": {
312326
"additionalProperties": {
313-
"pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$",
314-
"type": "string"
327+
"type": "string",
328+
"pattern": "^((\\d{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)%||(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?)$"
315329
},
316330
"description": "EvictionSoft is the map of signal names to quantities that define soft eviction thresholds",
317331
"type": "object",
@@ -351,8 +365,8 @@
351365
},
352366
"kubeReserved": {
353367
"additionalProperties": {
354-
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
355-
"type": "string"
368+
"type": "string",
369+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
356370
},
357371
"description": "KubeReserved contains resources reserved for Kubernetes system components.",
358372
"type": "object",
@@ -381,8 +395,8 @@
381395
},
382396
"systemReserved": {
383397
"additionalProperties": {
384-
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
385-
"type": "string"
398+
"type": "string",
399+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
386400
},
387401
"description": "SystemReserved contains resources reserved for OS system daemons and kernel memory.",
388402
"type": "object",
@@ -464,16 +478,12 @@
464478
"additionalProperties": false
465479
},
466480
"role": {
467-
"description": "Role is the AWS identity that nodes use. This field is immutable.\nThis field is mutually exclusive from instanceProfile.\nMarking this field as immutable avoids concerns around terminating managed instance profiles from running instances.\nThis field may be made mutable in the future, assuming the correct garbage collection and drift handling is implemented\nfor the old instance profiles on an update.",
481+
"description": "Role is the AWS identity that nodes use.\nThis field is mutually exclusive from instanceProfile.",
468482
"type": "string",
469483
"x-kubernetes-validations": [
470484
{
471485
"message": "role cannot be empty",
472486
"rule": "self != ''"
473-
},
474-
{
475-
"message": "immutable field changed",
476-
"rule": "self == oldSelf"
477487
}
478488
]
479489
},
@@ -624,10 +634,6 @@
624634
"message": "must specify exactly one of ['role', 'instanceProfile']",
625635
"rule": "(has(self.role) && !has(self.instanceProfile)) || (!has(self.role) && has(self.instanceProfile))"
626636
},
627-
{
628-
"message": "changing from 'instanceProfile' to 'role' is not supported. You must delete and recreate this node class if you want to change this.",
629-
"rule": "(has(oldSelf.role) && has(self.role)) || (has(oldSelf.instanceProfile) && has(self.instanceProfile))"
630-
},
631637
{
632638
"message": "if set, amiFamily must be 'AL2' or 'Custom' when using an AL2 alias",
633639
"rule": "!has(self.amiFamily) || (self.amiSelectorTerms.exists(x, has(x.alias) && x.alias.find('^[^@]+') == 'al2') ? (self.amiFamily == 'Custom' || self.amiFamily == 'AL2') : true)"
@@ -750,6 +756,24 @@
750756
"description": "The ID of the AWS account that owns the capacity reservation.",
751757
"pattern": "^[0-9]{12}$",
752758
"type": "string"
759+
},
760+
"reservationType": {
761+
"default": "default",
762+
"description": "The type of capacity reservation.",
763+
"enum": [
764+
"default",
765+
"capacity-block"
766+
],
767+
"type": "string"
768+
},
769+
"state": {
770+
"default": "active",
771+
"description": "The state of the capacity reservation. A capacity reservation is considered to be expiring if it is within the EC2\nreclaimation window. Only capacity-block reservations may be in this state.",
772+
"enum": [
773+
"active",
774+
"expiring"
775+
],
776+
"type": "string"
753777
}
754778
},
755779
"required": [

karpenter.sh/nodeclaim_v1.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
"properties": {
7272
"key": {
7373
"description": "The label key that the selector applies to.",
74+
"type": "string",
7475
"maxLength": 316,
7576
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$",
76-
"type": "string",
7777
"x-kubernetes-validations": [
7878
{
7979
"message": "label domain \"kubernetes.io\" is restricted",
@@ -93,7 +93,7 @@
9393
},
9494
{
9595
"message": "label domain \"karpenter.k8s.aws\" is restricted",
96-
"rule": "self in [\"karpenter.k8s.aws/capacity-reservation-id\", \"karpenter.k8s.aws/ec2nodeclass\", \"karpenter.k8s.aws/instance-encryption-in-transit-supported\", \"karpenter.k8s.aws/instance-category\", \"karpenter.k8s.aws/instance-hypervisor\", \"karpenter.k8s.aws/instance-family\", \"karpenter.k8s.aws/instance-generation\", \"karpenter.k8s.aws/instance-local-nvme\", \"karpenter.k8s.aws/instance-size\", \"karpenter.k8s.aws/instance-cpu\", \"karpenter.k8s.aws/instance-cpu-manufacturer\", \"karpenter.k8s.aws/instance-cpu-sustained-clock-speed-mhz\", \"karpenter.k8s.aws/instance-memory\", \"karpenter.k8s.aws/instance-ebs-bandwidth\", \"karpenter.k8s.aws/instance-network-bandwidth\", \"karpenter.k8s.aws/instance-gpu-name\", \"karpenter.k8s.aws/instance-gpu-manufacturer\", \"karpenter.k8s.aws/instance-gpu-count\", \"karpenter.k8s.aws/instance-gpu-memory\", \"karpenter.k8s.aws/instance-accelerator-name\", \"karpenter.k8s.aws/instance-accelerator-manufacturer\", \"karpenter.k8s.aws/instance-accelerator-count\"] || !self.find(\"^([^/]+)\").endsWith(\"karpenter.k8s.aws\")"
96+
"rule": "self in [\"karpenter.k8s.aws/instance-tenancy\", \"karpenter.k8s.aws/capacity-reservation-type\", \"karpenter.k8s.aws/capacity-reservation-id\", \"karpenter.k8s.aws/ec2nodeclass\", \"karpenter.k8s.aws/instance-encryption-in-transit-supported\", \"karpenter.k8s.aws/instance-category\", \"karpenter.k8s.aws/instance-hypervisor\", \"karpenter.k8s.aws/instance-family\", \"karpenter.k8s.aws/instance-generation\", \"karpenter.k8s.aws/instance-local-nvme\", \"karpenter.k8s.aws/instance-size\", \"karpenter.k8s.aws/instance-cpu\", \"karpenter.k8s.aws/instance-cpu-manufacturer\", \"karpenter.k8s.aws/instance-cpu-sustained-clock-speed-mhz\", \"karpenter.k8s.aws/instance-memory\", \"karpenter.k8s.aws/instance-ebs-bandwidth\", \"karpenter.k8s.aws/instance-network-bandwidth\", \"karpenter.k8s.aws/instance-gpu-name\", \"karpenter.k8s.aws/instance-gpu-manufacturer\", \"karpenter.k8s.aws/instance-gpu-count\", \"karpenter.k8s.aws/instance-gpu-memory\", \"karpenter.k8s.aws/instance-accelerator-name\", \"karpenter.k8s.aws/instance-accelerator-manufacturer\", \"karpenter.k8s.aws/instance-accelerator-count\", \"karpenter.k8s.aws/instance-capability-flex\"] || !self.find(\"^([^/]+)\").endsWith(\"karpenter.k8s.aws\")"
9797
}
9898
]
9999
},
@@ -105,25 +105,25 @@
105105
},
106106
"operator": {
107107
"description": "Represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.",
108+
"type": "string",
108109
"enum": [
109110
"In",
110111
"NotIn",
111112
"Exists",
112113
"DoesNotExist",
113114
"Gt",
114115
"Lt"
115-
],
116-
"type": "string"
116+
]
117117
},
118118
"values": {
119119
"description": "An array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. If the operator is Gt or Lt, the values\narray must have a single element, which will be interpreted as an integer.\nThis array is replaced during a strategic merge patch.",
120120
"items": {
121121
"type": "string"
122122
},
123-
"maxLength": 63,
124-
"pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$",
125123
"type": "array",
126-
"x-kubernetes-list-type": "atomic"
124+
"x-kubernetes-list-type": "atomic",
125+
"maxLength": 63,
126+
"pattern": "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
127127
}
128128
},
129129
"required": [
@@ -180,28 +180,28 @@
180180
"properties": {
181181
"effect": {
182182
"description": "Required. The effect of the taint on pods\nthat do not tolerate the taint.\nValid effects are NoSchedule, PreferNoSchedule and NoExecute.",
183+
"type": "string",
183184
"enum": [
184185
"NoSchedule",
185186
"PreferNoSchedule",
186187
"NoExecute"
187-
],
188-
"type": "string"
188+
]
189189
},
190190
"key": {
191191
"description": "Required. The taint key to be applied to a node.",
192+
"type": "string",
192193
"minLength": 1,
193-
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$",
194-
"type": "string"
194+
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$"
195195
},
196196
"timeAdded": {
197-
"description": "TimeAdded represents the time at which the taint was added.\nIt is only written for NoExecute taints.",
197+
"description": "TimeAdded represents the time at which the taint was added.",
198198
"format": "date-time",
199199
"type": "string"
200200
},
201201
"value": {
202202
"description": "The taint value corresponding to the taint key.",
203-
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$",
204-
"type": "string"
203+
"type": "string",
204+
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$"
205205
}
206206
},
207207
"required": [
@@ -220,28 +220,28 @@
220220
"properties": {
221221
"effect": {
222222
"description": "Required. The effect of the taint on pods\nthat do not tolerate the taint.\nValid effects are NoSchedule, PreferNoSchedule and NoExecute.",
223+
"type": "string",
223224
"enum": [
224225
"NoSchedule",
225226
"PreferNoSchedule",
226227
"NoExecute"
227-
],
228-
"type": "string"
228+
]
229229
},
230230
"key": {
231231
"description": "Required. The taint key to be applied to a node.",
232+
"type": "string",
232233
"minLength": 1,
233-
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$",
234-
"type": "string"
234+
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$"
235235
},
236236
"timeAdded": {
237-
"description": "TimeAdded represents the time at which the taint was added.\nIt is only written for NoExecute taints.",
237+
"description": "TimeAdded represents the time at which the taint was added.",
238238
"format": "date-time",
239239
"type": "string"
240240
},
241241
"value": {
242242
"description": "The taint value corresponding to the taint key.",
243-
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$",
244-
"type": "string"
243+
"type": "string",
244+
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(\\/))?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$"
245245
}
246246
},
247247
"required": [

0 commit comments

Comments
 (0)