r/kubernetes • u/SaiPisey02 • 3h ago
PSA: since 1.35 the kubelet refuses to start on cgroup v1 nodes. One-liner to check every node without SSH
Since v1.35 the kubelet setting failCgroupV1 defaults to true, so on a node still running cgroup v1 the kubelet does not start. kubeadm's SystemVerification preflight also errors on init/join/upgrade once the kubelet is 1.35+. On a control-plane node that means the static pods (API server, etcd) do not come back after a reboot either.
Check a node:
stat -fc %T /sys/fs/cgroup/
cgroup2fs = v2, fine. tmpfs = v1.
Check every node from your laptop, no SSH:
for n in $(kubectl get nodes -o name); do
printf "%s " "$n"
kubectl debug "$n" -n default -q -i --profile=general --image=busybox \
-- chroot /host stat -fc %T /sys/fs/cgroup
done
Two gotchas from testing it on a 1.35 kind cluster:
- Keep the
chroot /host. Busybox's ownstatdoes not know the cgroup2 magic and printsUNKNOWNon a healthy v2 node. - It leaves one
node-debugger-*pod per node behind:kubectl get pods -n default -o name | grep node-debugger | xargs kubectl delete -n default
Defaults to v1: CentOS 7, RHEL 7/8, Ubuntu 18.04/20.04, Amazon Linux 2. Most of those ship a kernel below the documented 5.8 minimum, and AWS does not support v2 on AL2 at all, so a kernel argument will not fix them. They need a new OS image.
failCgroupV1: false is the escape hatch; KEP-5573 slates removal for no earlier than 1.38.
I wrote up the full checklist (requirements, driver checks, in-place switch vs replace) here: https://saipisey.com/blog/cgroup-v1-kubelet-check
Happy to be corrected if your distro behaves differently.
