devops11 min read

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

AI Summary

Kubernetes has deprecated cgroup v1, with v1 support moving into maintenance mode in v1.31 and failing by default on v1.35 nodes via `failCgroupV1`. Moving to cgroup v2 enables key features like unified hierarchy, Pressure Stall Information (PSI) reporting, container-aware OOM handling via `memory.oom.group`, secure rootless container delegation, and accurate enforcement for in-place Pod vertical scaling. Upgrading requires migrating Linux nodes, verifying kernel versions (5.8+ recommended), and updating software that reads cgroup paths or relies on old CPU shares-to-weight conversions.

Key Takeaways

  • Starting with Kubernetes v1.35, `failCgroupV1` defaults to true, causing nodes running cgroup v1 to fail kubelet startup unless explicitly overridden.
  • cgroup v2 is strictly required for advanced features such as Memory QoS tiered protection, Pressure Stall Information (PSI), and in-place Pod vertical scaling.
  • Runtime changes include non-linear conversions from cgroup v1 CPU shares to cgroup v2 CPU weight in runc v1.3.2 and crun v1.23.

Why it matters

Operating modern Kubernetes clusters requires migrating to cgroup v2 to maintain upgrade paths, unlock advanced resource isolation, utilize PSI monitoring, and support features like in-place vertical scaling and container-aware OOM kills.

# kubernetes# cgroup v2# linux kernel# devops

Conversation 0

Be the first to share your perspective.