OpsCanary
kubernetesschedulingPractitioner

Navigating the Shift to cgroup v2 in Kubernetes

5 min read Kubernetes BlogOct 6, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

The shift to cgroup v2 in Kubernetes is a significant evolution that addresses resource management challenges in containerized environments. Control groups (cgroups) are a kernel feature that helps manage system resources, ensuring that applications run smoothly without stepping on each other's toes. With Kubernetes v1.25, support for cgroup v2 became stable, and from v1.35, the kubelet defaults to not starting on cgroup v1 nodes, pushing users towards the newer model.

Kubernetes utilizes cgroups to allocate resources like CPU and memory to containers. The kubelet coordinates changes between Pod-level and container cgroups, allowing for dynamic adjustments. For instance, when memory reservations are increased, it creates headroom before container limits grow, while decreases constrain containers before shrinking the Pod-level boundary. Key configuration parameters include failCgroupV1, which controls kubelet behavior on cgroup v1 nodes, and memoryReservationPolicy, which determines how memory reservations are handled. The introduction of Memory QoS as an alpha feature in Kubernetes v1.22 adds tiered memory protection, separating memory throttling from memory reservation.

In production, be cautious with alpha features like Memory QoS. The Kubernetes recommendation is to avoid enabling alpha features in production environments unless you thoroughly test them. If you decide to use Memory QoS with tiered reservations, account for hard-reserved memory before enabling the TieredReservation feature gate. Additionally, ensure your environment meets the prerequisites, including a Linux node with cgroup v2 enabled and a compatible kernel version. The kubelet logs warnings when Memory QoS is enabled on affected kernels, so stay vigilant about your configurations.

Key takeaways

  • →Understand cgroups as a kernel feature for managing system resources.
  • →Configure `failCgroupV1` to control kubelet startup behavior on cgroup v1 nodes.
  • →Utilize `memoryReservationPolicy` to manage memory reservations effectively.
  • →Be cautious with alpha features like Memory QoS; test thoroughly before production use.
  • →Ensure your environment meets the prerequisites for cgroup v2 support.

Why it matters

Transitioning to cgroup v2 allows for more efficient resource management in Kubernetes, which can lead to improved application performance and stability in production environments. Properly leveraging these features can help prevent resource contention and ensure smoother operations.

Code examples

YAML
1apiVersion: kubelet.config.k8s.io/v1beta1
2kind: KubeletConfiguration
3featureGates:
4  MemoryQoS: true
5memoryReservationPolicy: TieredReservation
6memoryThrottlingFactor: 0.9

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Linux FoundationSponsor

Industry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.

Get CKA certified →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.