Fix cgroup handling for systemd with cgroup v2

This fixes issues where kubelet enforces qos and nodeAllocatable on the
worng hierarchy. Kublet will now create the files

/sys/fs/cgroup/kubepods/{burstable,besteffort,}/pod-xyz

when running with systemd as the driver, making it impossible to enforce
the limits on nodeAllocatable.
This commit is contained in:
Odin Ugedal 2021-01-25 14:20:37 +01:00
parent b2b8c1f18d
commit 124de526cb

View File

@ -577,7 +577,7 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error {
unified := libcontainercgroups.IsCgroup2UnifiedMode()
if unified {
libcontainerCgroupConfig.Path = cgroupConfig.Name.ToCgroupfs()
libcontainerCgroupConfig.Path = m.Name(cgroupConfig.Name)
} else {
libcontainerCgroupConfig.Paths = m.buildCgroupPaths(cgroupConfig.Name)
}