2.9 KiB
OS package update runbook for Hetzner cluster nodes
Order: master first, then workers, ONE NODE AT A TIME.
Verify each node is Ready before uncordoning and before moving to the next.
Replace <node> with: master-4gb-hel1-2 | ubuntu-4gb-hel1-docker | woker-1-8gb-hel1-1
Per-node sequence
-
From your admin machine: cordon + drain the node so workloads migrate
kubectl drain <node> --ignore-daemonsets --delete-emptydir-data -
Confirm drain finished (pods gone, node marked
SchedulingDisabled)kubectl get nodes kubectl get pods -A --field-selector spec.nodeName=<node> --watch -
SSH into the node
ssh <node> -
Inside the node: update OS packages
sudo apt update && sudo apt upgrade -y sudo apt autoremove -y -
(Optional) check what needs a reboot; usually kernel/glibc upgrades do
cat /var/run/reboot-required 2>/dev/null || echo "no reboot required" -
Reboot the node to apply kernel updates
sudo reboot -
Wait for the node to come back, then from your admin machine verify it's
Readykubectl get nodes -w # Wait for: <node> Ready <role> <age> <version> -
Uncordon the node so it accepts pods again
kubectl uncordon <node> -
Verify workloads re-scheduled and healthy
kubectl get pods -A --field-selector spec.nodeName=<node> kubectl get nodes
Full sequence
master-4gb-hel1-2
kubectl drain master-4gb-hel1-2 --ignore-daemonsets --delete-emptydir-data
# ssh master-4gb-hel1-2 -> sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# sudo reboot
# (wait for Ready)
kubectl uncordon master-4gb-hel1-2
ubuntu-4gb-hel1-docker
kubectl drain ubuntu-4gb-hel1-docker --ignore-daemonsets --delete-emptydir-data
# ssh ubuntu-4gb-hel1-docker -> sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# sudo reboot
# (wait for Ready)
kubectl uncordon ubuntu-4gb-hel1-docker
woker-1-8gb-hel1-1
kubectl drain woker-1-8gb-hel1-1 --ignore-daemonsets --delete-emptydir-data
# ssh woker-1-8gb-hel1-1 -> sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# sudo reboot
# (wait for Ready)
kubectl uncordon woker-1-8gb-hel1-1
Notes
-
Do NOT upgrade
kubelet/kubeadm/kubectlvia apt without following the upstream kubeadm cluster-upgrade procedure first. Pin those packages:sudo apt-mark hold kubelet kubeadm kubectl kubernetes-cniOr check the held state with:
apt-mark showhold -
If a kernel update is not in the upgrade set and you want to skip the reboot, skip step 6 and go straight to uncordon after
apt upgrade. -
Hetzner CSI/Cilium DaemonSets stay running during drain (
--ignore-daemonsets); that's expected and safe.