Skip to content

Commit 105c0c6

Browse files
authored
Merge pull request kubernetes#88970 from mysunshine92/correct-NodeAllocatableRoot
fix function NodeAllocatableRoot
2 parents 250884c + 6783f99 commit 105c0c6

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

cmd/kubelet/app/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate f
608608
}
609609

610610
var cgroupRoots []string
611-
612-
cgroupRoots = append(cgroupRoots, cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupDriver))
611+
nodeAllocatableRoot := cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupsPerQOS, s.CgroupDriver)
612+
cgroupRoots = append(cgroupRoots, nodeAllocatableRoot)
613613
kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups)
614614
if err != nil {
615615
klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err)

pkg/kubelet/cm/helpers_linux.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,11 @@ func GetPodCgroupNameSuffix(podUID types.UID) string {
276276
}
277277

278278
// NodeAllocatableRoot returns the literal cgroup path for the node allocatable cgroup
279-
func NodeAllocatableRoot(cgroupRoot, cgroupDriver string) string {
280-
root := ParseCgroupfsToCgroupName(cgroupRoot)
281-
nodeAllocatableRoot := NewCgroupName(root, defaultNodeAllocatableCgroupName)
279+
func NodeAllocatableRoot(cgroupRoot string, cgroupsPerQOS bool, cgroupDriver string) string {
280+
nodeAllocatableRoot := ParseCgroupfsToCgroupName(cgroupRoot)
281+
if cgroupsPerQOS {
282+
nodeAllocatableRoot = NewCgroupName(nodeAllocatableRoot, defaultNodeAllocatableCgroupName)
283+
}
282284
if libcontainerCgroupManagerType(cgroupDriver) == libcontainerSystemd {
283285
return nodeAllocatableRoot.ToSystemd()
284286
}

pkg/kubelet/cm/helpers_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func GetPodCgroupNameSuffix(podUID types.UID) string {
6161
}
6262

6363
// NodeAllocatableRoot returns the literal cgroup path for the node allocatable cgroup
64-
func NodeAllocatableRoot(cgroupRoot, cgroupDriver string) string {
64+
func NodeAllocatableRoot(cgroupRoot string, cgroupsPerQOS bool, cgroupDriver string) string {
6565
return ""
6666
}
6767

0 commit comments

Comments
 (0)