Pcornel
Containers · Container Fundamentals

Control Groups (cgroups v2)

Cheat sheet · https://pcornel.dk/topic.php?topic=6120

Back to the Topic

Answer

cgroups v2 is the unified Linux control-group hierarchy that limits and accounts CPU, memory, I/O and pids for groups of processes. Container runtimes and systemd use it for resource limits.

Remember

Check that host, runtime and kubelet agree on cgroup v2 and the systemd driver. Memory limits are hard (OOM kill); CPU limits throttle. Read memory.events and cpu.stat for evidence.

First checks

  • cat /proc/<pid>/cgroup — cgroup path
  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state

Verify in this order

process in a cgroup → controllers enforce limits → events/stats recorded

Where it usually breaks

Mixing cgroup drivers (cgroupfs versus systemd) between kubelet and runtime causes unstable nodes.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6120

Confirmation

Confirm action

Continue?