Skip to content

Commit b01c2df

Browse files
committed
nodes config: add minimumKubeletVersion to status
Signed-off-by: Peter Hunt <[email protected]>
1 parent 1237325 commit b01c2df

11 files changed

+205
-1
lines changed

config/v1/types_node.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ type NodeStatus struct {
7474
// +listMapKey=type
7575
// +optional
7676
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
77+
78+
// minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
79+
// Specifically, the apiserver will deny most authorization requests of kubelets that are older
80+
// than the specified version, only allowing the kubelet to get and update its node object, and perform
81+
// subjectaccessreviews.
82+
// This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
83+
// and will eventually be marked as not ready.
84+
// Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
85+
// Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
86+
// the underlying kubernetes version this version of Openshift is based off of.
87+
// In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
88+
// they should set the minimumKubeletVersion to 1.30.0.
89+
// When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
90+
// Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
91+
// This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
92+
// FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
93+
// all kubelets.
94+
// +kubebuilder:validation:XValidation:rule="self == \"\" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')",message="minmumKubeletVersion must be in a semver compatible format of x.y.z, or empty"
95+
// +kubebuilder:validation:MaxLength:=8
96+
// +openshift:enable:FeatureGate=MinimumKubeletVersion
97+
// +optional
98+
MinimumKubeletVersion string `json:"minimumKubeletVersion"`
7799
}
78100

79101
// +kubebuilder:validation:Enum=v1;v2;""

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-CustomNoUpgrade.crd.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ spec:
148148
x-kubernetes-list-map-keys:
149149
- type
150150
x-kubernetes-list-type: map
151+
minimumKubeletVersion:
152+
description: |-
153+
minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
154+
Specifically, the apiserver will deny most authorization requests of kubelets that are older
155+
than the specified version, only allowing the kubelet to get and update its node object, and perform
156+
subjectaccessreviews.
157+
This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
158+
and will eventually be marked as not ready.
159+
Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
160+
Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
161+
the underlying kubernetes version this version of Openshift is based off of.
162+
In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
163+
they should set the minimumKubeletVersion to 1.30.0.
164+
When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
165+
Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
166+
This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
167+
FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
168+
all kubelets.
169+
maxLength: 8
170+
type: string
171+
x-kubernetes-validations:
172+
- message: minmumKubeletVersion must be in a semver compatible format
173+
of x.y.z, or empty
174+
rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
151175
type: object
152176
required:
153177
- spec

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-DevPreviewNoUpgrade.crd.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ spec:
148148
x-kubernetes-list-map-keys:
149149
- type
150150
x-kubernetes-list-type: map
151+
minimumKubeletVersion:
152+
description: |-
153+
minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
154+
Specifically, the apiserver will deny most authorization requests of kubelets that are older
155+
than the specified version, only allowing the kubelet to get and update its node object, and perform
156+
subjectaccessreviews.
157+
This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
158+
and will eventually be marked as not ready.
159+
Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
160+
Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
161+
the underlying kubernetes version this version of Openshift is based off of.
162+
In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
163+
they should set the minimumKubeletVersion to 1.30.0.
164+
When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
165+
Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
166+
This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
167+
FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
168+
all kubelets.
169+
maxLength: 8
170+
type: string
171+
x-kubernetes-validations:
172+
- message: minmumKubeletVersion must be in a semver compatible format
173+
of x.y.z, or empty
174+
rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
151175
type: object
152176
required:
153177
- spec

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-TechPreviewNoUpgrade.crd.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ spec:
148148
x-kubernetes-list-map-keys:
149149
- type
150150
x-kubernetes-list-type: map
151+
minimumKubeletVersion:
152+
description: |-
153+
minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
154+
Specifically, the apiserver will deny most authorization requests of kubelets that are older
155+
than the specified version, only allowing the kubelet to get and update its node object, and perform
156+
subjectaccessreviews.
157+
This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
158+
and will eventually be marked as not ready.
159+
Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
160+
Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
161+
the underlying kubernetes version this version of Openshift is based off of.
162+
In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
163+
they should set the minimumKubeletVersion to 1.30.0.
164+
When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
165+
Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
166+
This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
167+
FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
168+
all kubelets.
169+
maxLength: 8
170+
type: string
171+
x-kubernetes-validations:
172+
- message: minmumKubeletVersion must be in a semver compatible format
173+
of x.y.z, or empty
174+
rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
151175
type: object
152176
required:
153177
- spec

config/v1/zz_generated.featuregated-crd-manifests/nodes.config.openshift.io/MinimumKubeletVersion.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ spec:
148148
x-kubernetes-list-map-keys:
149149
- type
150150
x-kubernetes-list-type: map
151+
minimumKubeletVersion:
152+
description: |-
153+
minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
154+
Specifically, the apiserver will deny most authorization requests of kubelets that are older
155+
than the specified version, only allowing the kubelet to get and update its node object, and perform
156+
subjectaccessreviews.
157+
This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
158+
and will eventually be marked as not ready.
159+
Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
160+
Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
161+
the underlying kubernetes version this version of Openshift is based off of.
162+
In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
163+
they should set the minimumKubeletVersion to 1.30.0.
164+
When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
165+
Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
166+
This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
167+
FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
168+
all kubelets.
169+
maxLength: 8
170+
type: string
171+
x-kubernetes-validations:
172+
- message: minmumKubeletVersion must be in a semver compatible format
173+
of x.y.z, or empty
174+
rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
151175
type: object
152176
required:
153177
- spec

config/v1/zz_generated.swagger_doc_generated.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8374,6 +8374,11 @@
83748374
"x-kubernetes-list-type": "map",
83758375
"x-kubernetes-patch-merge-key": "type",
83768376
"x-kubernetes-patch-strategy": "merge"
8377+
},
8378+
"minimumKubeletVersion": {
8379+
"description": "minimumKubeletVersion is the lowest version of a kubelet that can join the cluster. Specifically, the apiserver will deny most authorization requests of kubelets that are older than the specified version, only allowing the kubelet to get and update its node object, and perform subjectaccessreviews. This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads, and will eventually be marked as not ready. Its max length is 8, so maximum version allowed is either \"9.999.99\" or \"99.99.99\". Since the kubelet reports the version of the kubernetes release, not Openshift, this field references the underlying kubernetes version this version of Openshift is based off of. In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then they should set the minimumKubeletVersion to 1.30.0. When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version. Thus, a kubelet with version \"1.0.0-ec.0\" will be compatible with minimumKubeletVersion \"1.0.0\" or earlier. This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to all kubelets.",
8380+
"type": "string",
8381+
"default": ""
83778382
}
83788383
}
83798384
},

payload-manifests/crds/0000_10_config-operator_01_nodes-CustomNoUpgrade.crd.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ spec:
148148
x-kubernetes-list-map-keys:
149149
- type
150150
x-kubernetes-list-type: map
151+
minimumKubeletVersion:
152+
description: |-
153+
minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
154+
Specifically, the apiserver will deny most authorization requests of kubelets that are older
155+
than the specified version, only allowing the kubelet to get and update its node object, and perform
156+
subjectaccessreviews.
157+
This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
158+
and will eventually be marked as not ready.
159+
Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
160+
Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
161+
the underlying kubernetes version this version of Openshift is based off of.
162+
In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
163+
they should set the minimumKubeletVersion to 1.30.0.
164+
When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
165+
Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
166+
This status field is used to reflect the actualized minimum kubelet version, which can be interpreted from the
167+
FeatureGateStatus.RenderedMinimumComponentVersion when Component == Kubelet, after that FeatureGateStatus finishes rolling out to
168+
all kubelets.
169+
maxLength: 8
170+
type: string
171+
x-kubernetes-validations:
172+
- message: minmumKubeletVersion must be in a semver compatible format
173+
of x.y.z, or empty
174+
rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
151175
type: object
152176
required:
153177
- spec

0 commit comments

Comments
 (0)