Skip to content

Commit

Permalink
Do not set KubeletCredentialProviders feature flag for 1.28+ (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
camrakin authored Aug 4, 2023
1 parent 4f89179 commit 30ccd21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions files/kubelet-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"cgroupDriver": "cgroupfs",
"cgroupRoot": "/",
"featureGates": {
"RotateKubeletServerCertificate": true,
"KubeletCredentialProviders": true
"RotateKubeletServerCertificate": true
},
"protectKernelDefaults": true,
"serializeImagePulls": false,
Expand Down
7 changes: 7 additions & 0 deletions scripts/install-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ if [[ $KUBERNETES_VERSION == "1.20"* ]]; then
echo $KUBELET_CONFIG_WITH_CSI_SERVICE_ACCOUNT_TOKEN_ENABLED > $WORKING_DIR/kubelet-config.json
fi

# Enable Feature Gate for KubeletCredentialProviders in versions less than 1.28 since this feature flag was removed in 1.28.
# TODO: Remove this during 1.27 EOL
if vercmp $KUBERNETES_VERSION lt "1.28"; then
KUBELET_CONFIG_WITH_KUBELET_CREDENTIAL_PROVIDER_FEATURE_GATE_ENABLED=$(cat $WORKING_DIR/kubelet-config.json | jq '.featureGates += {KubeletCredentialProviders: true}')
echo $KUBELET_CONFIG_WITH_KUBELET_CREDENTIAL_PROVIDER_FEATURE_GATE_ENABLED > $WORKING_DIR/kubelet-config.json
fi

sudo mv $WORKING_DIR/kubelet.service /etc/systemd/system/kubelet.service
sudo chown root:root /etc/systemd/system/kubelet.service
sudo mv $WORKING_DIR/kubelet-config.json /etc/kubernetes/kubelet/kubelet-config.json
Expand Down

0 comments on commit 30ccd21

Please sign in to comment.