Interview Prep/Kubernetes/Nodes, kubelet and container runtime

After a reboot the kubelet will not start: `failed to run Kubelet: running with swap on is not supported, please disable swap!`.

BeginnerTroubleshootingNodes, kubelet and container runtime
Answer

Likely causes → Swap was re-enabled on boot (/etc/fstab entry) and the kubelet is configured with the default failSwapOn: true.

Diagnose →

swapon --show
grep swap /etc/fstab
journalctl -u kubelet -n 20 --no-pager

Fix →

sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab
sudo systemctl restart kubelet

Swap support (NodeSwap, swapBehavior: LimitedSwap) exists on cgroup v2 in newer versions, but it must be configured deliberately.

Prevent → Disable swap in the node image build.

All Kubernetes questions

More on Nodes, kubelet and container runtime