diff --git a/machineconfiguration/v1/types.go b/machineconfiguration/v1/types.go index 6673adeb1b2..586a52f7ba7 100644 --- a/machineconfiguration/v1/types.go +++ b/machineconfiguration/v1/types.go @@ -422,7 +422,11 @@ type MachineConfigPoolSpec struct { // to stop updates, use the 'paused' property instead. Drain will respect // Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if // maxUnavailable is greater than one. + // When specified as an integer, the value must be greater than 0. + // When specified as a string, it must be a percentage (e.g., "50%"). // +optional + // +kubebuilder:validation:XIntOrString + // +kubebuilder:validation:XValidation:rule="type(self) == int ? self > 0 : type(self) == string && self.matches('^[0-9]+%$')",message="must be a positive integer greater than 0, or a percentage string (e.g., '50%')" MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` // The targeted MachineConfig object for the machine config pool. diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-CustomNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-CustomNoUpgrade.crd.yaml index 6dc75e209b5..45f3d67e82d 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-CustomNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-CustomNoUpgrade.crd.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-Default.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-Default.crd.yaml index b551493e48b..90ed86cf0db 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-Default.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-Default.crd.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-DevPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-DevPreviewNoUpgrade.crd.yaml index 48688e4791b..a289b139b24 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-DevPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-DevPreviewNoUpgrade.crd.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-OKD.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-OKD.crd.yaml index 748c9ffea78..474124838e8 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-OKD.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-OKD.crd.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-TechPreviewNoUpgrade.crd.yaml b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-TechPreviewNoUpgrade.crd.yaml index 12bb88dfd59..af842ab8ed0 100644 --- a/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-TechPreviewNoUpgrade.crd.yaml +++ b/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools-TechPreviewNoUpgrade.crd.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/AAA_ungated.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/AAA_ungated.yaml index 3250e6ce015..462fae4fc02 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/AAA_ungated.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/AAA_ungated.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/OSStreams.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/OSStreams.yaml index 3b4a627e244..a2951a97ba0 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/OSStreams.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/OSStreams.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/PinnedImages.yaml b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/PinnedImages.yaml index 55125ad29bf..ad1fd8c9c0d 100644 --- a/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/PinnedImages.yaml +++ b/machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfigpools.machineconfiguration.openshift.io/PinnedImages.yaml @@ -246,7 +246,13 @@ spec: to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. + When specified as an integer, the value must be greater than 0. + When specified as a string, it must be a percentage (e.g., "50%"). x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: must be a positive integer greater than 0, or a percentage + string (e.g., '50%') + rule: 'type(self) == int ? self > 0 : type(self) == string && self.matches(''^[0-9]+%$'')' nodeSelector: description: nodeSelector specifies a label selector for Machines properties: diff --git a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 650fc1709da..21b2e427d41 100644 --- a/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -286,7 +286,7 @@ var map_MachineConfigPoolSpec = map[string]string{ "machineConfigSelector": "machineConfigSelector specifies a label selector for MachineConfigs. Refer https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ on how label and selectors work.", "nodeSelector": "nodeSelector specifies a label selector for Machines", "paused": "paused specifies whether or not changes to this machine config pool should be stopped. This includes generating new desiredMachineConfig and update of machines.", - "maxUnavailable": "maxUnavailable defines either an integer number or percentage of nodes in the pool that can go Unavailable during an update. This includes nodes Unavailable for any reason, including user initiated cordons, failing nodes, etc. The default value is 1.\n\nA value larger than 1 will mean multiple nodes going unavailable during the update, which may affect your workload stress on the remaining nodes. You cannot set this value to 0 to stop updates (it will default back to 1); to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one.", + "maxUnavailable": "maxUnavailable defines either an integer number or percentage of nodes in the pool that can go Unavailable during an update. This includes nodes Unavailable for any reason, including user initiated cordons, failing nodes, etc. The default value is 1.\n\nA value larger than 1 will mean multiple nodes going unavailable during the update, which may affect your workload stress on the remaining nodes. You cannot set this value to 0 to stop updates (it will default back to 1); to stop updates, use the 'paused' property instead. Drain will respect Pod Disruption Budgets (PDBs) such as etcd quorum guards, even if maxUnavailable is greater than one. When specified as an integer, the value must be greater than 0. When specified as a string, it must be a percentage (e.g., \"50%\").", "configuration": "The targeted MachineConfig object for the machine config pool.", "pinnedImageSets": "pinnedImageSets specifies a sequence of PinnedImageSetRef objects for the pool. Nodes within this pool will preload and pin images defined in the PinnedImageSet. Before pulling images the MachineConfigDaemon will ensure the total uncompressed size of all the images does not exceed available resources. If the total size of the images exceeds the available resources the controller will report a Degraded status to the MachineConfigPool and not attempt to pull any images. Also to help ensure the kubelet can mitigate storage risk, the pinned_image configuration and subsequent service reload will happen only after all of the images have been pulled for each set. Images from multiple PinnedImageSets are loaded and pinned sequentially as listed. Duplicate and existing images will be skipped.\n\nAny failure to prefetch or pin images will result in a Degraded pool. Resolving these failures is the responsibility of the user. The admin should be proactive in ensuring adequate storage and proper image authentication exists in advance.", "osImageStream": "osImageStream specifies an OS stream to be used for the pool.\n\nThis field can be optionally set to a known OSImageStream name to change the OS and Extension images with a well-known, tested, release-provided set of images. This enables a streamlined way of switching the pool's node OS to a different version than the cluster default, such as transitioning to a major RHEL version.\n\nWhen set, the referenced stream overrides the cluster-wide OS images for the pool with the OS and Extensions associated to stream. When omitted, the pool uses the cluster-wide default OS images.",