client: enable support for cgroups v2
This PR introduces support for using Nomad on systems with cgroups v2 [1] enabled as the cgroups controller mounted on /sys/fs/cgroups. Newer Linux distros like Ubuntu 21.10 are shipping with cgroups v2 only, causing problems for Nomad users. Nomad mostly "just works" with cgroups v2 due to the indirection via libcontainer, but not so for managing cpuset cgroups. Before, Nomad has been making use of a feature in v1 where a PID could be a member of more than one cgroup. In v2 this is no longer possible, and so the logic around computing cpuset values must be modified. When Nomad detects v2, it manages cpuset values in-process, rather than making use of cgroup heirarchy inheritence via shared/reserved parents. Nomad will only activate the v2 logic when it detects cgroups2 is mounted at /sys/fs/cgroups. This means on systems running in hybrid mode with cgroups2 mounted at /sys/fs/cgroups/unified (as is typical) Nomad will continue to use the v1 logic, and should operat...
Showing
+647 -270
.changelog/12274.txt
0 → 100644
client/lib/cgutil/cgutil_default.go
deleted
100644 → 0
client/lib/cgutil/cgutil_linux_test.go
0 → 100644
client/lib/cgutil/cgutil_noop.go
0 → 100644
client/lib/cgutil/cpuset_manager_test.go
0 → 100644
Please register or sign in to comment