The Shift to cgroup v2 in Kube... Note

The Shift to cgroup v2 in Kubernetes: What You Need to Know

Kubernetes uses Linux cgroups to manage container resources, with a significant shift towards cgroup v2. Cgroup v1 support is now in maintenance mode and will be removed entirely in future Kubernetes releases. Cgroup v2 offers a unified hierarchy, a more consistent interface, and enhanced resource isolation. Kubernetes v1.31 marked cgroup v1 management as maintenance, while v2 has been stable since v1.25. Newer Kubernetes versions, like v1.35, default to failing kubelet startup on cgroup v1 nodes unless explicitly overridden. System verification checks in kubeadm will also flag cgroup v1 usage starting with v1.35. Cgroup v2 enables new features like Memory QoS with tiered protection, offering better memory management than cgroup v1. It also improves container-aware OOM handling by ensuring all processes within a container are killed together. Rootless container support is also officially better handled with cgroup v2's delegation capabilities. Migrating requires ensuring compatibility with kernel versions, container runtimes, and the kubelet configuration.