Merge pull request #85218 from giuseppe/cgroupv2

kubelet: add initial support for cgroupv2
This commit is contained in:
Kubernetes Prow Robot
2020-03-26 14:10:23 -07:00
committed by GitHub
4 changed files with 105 additions and 22 deletions

View File

@@ -161,6 +161,10 @@ func validateSystemRequirements(mountUtil mount.Interface) (features, error) {
return f, fmt.Errorf("%s - %v", localErr, err)
}
if cgroups.IsCgroup2UnifiedMode() {
return f, nil
}
expectedCgroups := sets.NewString("cpu", "cpuacct", "cpuset", "memory")
for _, mountPoint := range mountPoints {
if mountPoint.Type == cgroupMountType {
@@ -884,6 +888,11 @@ func getContainer(pid int) (string, error) {
return "", err
}
if cgroups.IsCgroup2UnifiedMode() {
c, _ := cgs[""]
return c, nil
}
cpu, found := cgs["cpu"]
if !found {
return "", cgroups.NewNotFoundError("cpu")