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 : {}
0 commit comments