Skip to content

Commit

Permalink
Fix kubelet upgrade on Container Linux (#556)
Browse files Browse the repository at this point in the history
* Properly stop and restart kubelet

On Container Linux, kubelet locks itself, this patch stops kubelet
before downloading the new binaries and then starts it back up once
everything is ready.

Signed-off-by: Daniël Franke <daniel@ams-sec.org>

* Download the binaries before stopping kubelet.

Signed-off-by: Daniël Franke <daniel@ams-sec.org>
  • Loading branch information
ainmosni authored and kubermatic-bot committed Jul 4, 2019
1 parent 53d2712 commit 570bba6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pkg/upgrader/upgrade/kubernetes_binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ curl -L "https://github.com/containernetworking/plugins/releases/download/v{{ .C
RELEASE="v{{ .KUBERNETES_VERSION }}"
sudo mkdir -p /opt/bin
cd /opt/bin
sudo mkdir -p /var/tmp/kube-binaries
cd /var/tmp/kube-binaries
sudo curl -L --remote-name-all \
https://storage.googleapis.com/kubernetes-release/release/${RELEASE}/bin/linux/amd64/{kubeadm,kubelet,kubectl}
sudo mkdir -p /opt/bin
cd /opt/bin
sudo systemctl stop kubelet
sudo mv /var/tmp/kube-binaries/{kubeadm,kubelet,kubectl} .
sudo chmod +x {kubeadm,kubelet,kubectl}
curl -sSL "https://raw.githubusercontent.com/kubernetes/kubernetes/${RELEASE}/build/debs/kubelet.service" | \
Expand All @@ -73,7 +81,10 @@ curl -sSL "https://raw.githubusercontent.com/kubernetes/kubernetes/${RELEASE}/bu
sudo mkdir -p /etc/systemd/system/kubelet.service.d
curl -sSL "https://raw.githubusercontent.com/kubernetes/kubernetes/${RELEASE}/build/debs/10-kubeadm.conf" | \
sed "s:/usr/bin:/opt/bin:g" | \
sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sudo systemctl daemon-reload
sudo systemctl start kubelet
`
)

Expand Down

0 comments on commit 570bba6

Please sign in to comment.