Interview Prep/Kubernetes/Nodes, kubelet and container runtime

On a new kubeadm node, static control-plane Pods and other Pods restart randomly every few minutes. Containerd is installed from the distro.

AdvancedTroubleshootingNodes, kubelet and container runtime
Answer

Likely causes → cgroup driver mismatch. The kubelet uses systemd (kubeadm default since 1.22) while containerd uses cgroupfs (SystemdCgroup = false). Two cgroup managers fight and containers get killed.

Diagnose →

grep -i cgroupDriver /var/lib/kubelet/config.yaml
grep -n SystemdCgroup /etc/containerd/config.toml
stat -fc %T /sys/fs/cgroup     # cgroup2fs = cgroup v2

Fix →

containerd config default | sudo tee /etc/containerd/config.toml
sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
sudo systemctl restart containerd kubelet

Prevent → Use a tested node image or bootstrap script that sets the systemd driver for both.

All Kubernetes questions

More on Nodes, kubelet and container runtime