As more recent and modern distributions update their kernel configurations, sometimes the default for cgroups will show as Version 2, instead of the well-established and standardized Version 1, as seen in the
docker info output below. How can an administrator modify this behavior?
... Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local ...
A special kernel paramater
systemd.unified_cgroup_hierarchy=0 will allow for both V1 and V2 versions of cgroups, with the default as Version 1. Without the parameter change, Docker containers may fail to start. Enabling hybrid support in this manner can ensure compatibility as the industry transitions between both versions.
- Kubernetes cluster nodes using current distributions with newer kernels
Enable both CGroups V1 and V2 with the kernel option
Modify your distribution's kernel commandline options, then run the appropriate update for your boot loader.
sudo sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub sudo grub2-mkconfig -o /boot/grub2/grub.cfg
After rebooting, check that the kernel parameter was added with
cat /proc/cmdline and output of
docker info, verifies that it shows
Cgroup Version: 1.