Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: write "cgroupfs" in the kubelet config #140

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions kubeadm/hack/e2e-cluster-gcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ sed -i "s/${privateIP}/${externalIP}/g" $KUBECONFIG
k8sVersion=$(kubectl version -ojson | jq -r .serverVersion.gitVersion)
sed "s/VERSION/${k8sVersion}/" "$REPO_ROOT/kubeadm/hack/startup/windows.ps1" > $scratchDir/windows.ps1

# Patch the cgroup driver in the kubelet config to be cgroupfs.
# Workaround for https://github.com/kubernetes/kubernetes/issues/97759
# This makes the joining Windows workers download a kubelet configuration that is compatible
# with the Docker defaults on Windows.
k8sVersionMajor=$(echo $k8sVersion | cut -d "." -f 1 | cut -c2-)
k8sVersionMinor=$(echo $k8sVersion | cut -d "." -f 2)
kubeletConfigName="kubelet-config-$k8sVersionMajor.$k8sVersionMinor"
kubeletTmpFile="/tmp/kubelet.yaml"
gcloud compute ssh "root@${ctrlPlaneNodeName}" --command "KUBECONFIG=/etc/kubernetes/admin.conf kubectl get cm -n kube-system $kubeletConfigName -o yaml > $kubeletTmpFile"
gcloud compute ssh "root@${ctrlPlaneNodeName}" --command "sed -i 's/cgroupDriver: systemd/cgroupDriver: cgroupfs/g' $kubeletTmpFile"
gcloud compute ssh "root@${ctrlPlaneNodeName}" --command "KUBECONFIG=/etc/kubernetes/admin.conf kubectl replace -f $kubeletTmpFile"

set +o xtrace
joinCmd="$(gcloud compute ssh root@${ctrlPlaneNodeName} --command "kubeadm token create --print-join-command") --ignore-preflight-errors=IsPrivilegedUser"

Expand Down