Skip to content

Commit 75b8cf9

Browse files
committed
Merge branch 'tke/v1.20.6' into 'tke/v1.20.6' (merge request !480)
移植upstream对kubelet及cadvisor的修改,修复使用cgroupv2时指标收集统计的问题 1. port cadvisor pr google/cadvisor#2839 reading cpu stats on cgroup v2 2. port cadvisor pr google/cadvisor#2837 read "max" value for cgroup v2 3. port cadvisor pr google/cadvisor#2801 gathering of stats for root cgroup on v2 4. port cadvisor pr google/cadvisor#2800: Update heuristic for container creation time 5. Fix cgroup handling for systemd with cgroup v2 6. test: adjust summary test for cgroup v2
2 parents af19637 + 4d24cc7 commit 75b8cf9

File tree

4 files changed

+117
-52
lines changed

4 files changed

+117
-52
lines changed

pkg/kubelet/cm/cgroup_manager_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error {
577577

578578
unified := libcontainercgroups.IsCgroup2UnifiedMode()
579579
if unified {
580-
libcontainerCgroupConfig.Path = cgroupConfig.Name.ToCgroupfs()
580+
libcontainerCgroupConfig.Path = m.Name(cgroupConfig.Name)
581581
} else {
582582
libcontainerCgroupConfig.Paths = m.buildCgroupPaths(cgroupConfig.Name)
583583
}

test/e2e_node/summary_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ var _ = framework.KubeDescribe("Summary API [NodeConformance]", func() {
114114
"UserDefinedMetrics": gomega.BeEmpty(),
115115
})
116116
}
117+
expectedMajorPageFaultsUpperBound := 10
118+
if IsCgroup2UnifiedMode() {
119+
expectedMajorPageFaultsUpperBound = 1000
120+
}
121+
117122
podsContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
118123
podsContExpectations.Fields["Memory"] = ptrMatchAllFields(gstruct.Fields{
119124
"Time": recent(maxStatsAge),
@@ -123,7 +128,7 @@ var _ = framework.KubeDescribe("Summary API [NodeConformance]", func() {
123128
"WorkingSetBytes": bounded(10*e2evolume.Kb, memoryLimit),
124129
"RSSBytes": bounded(1*e2evolume.Kb, memoryLimit),
125130
"PageFaults": bounded(0, 1000000),
126-
"MajorPageFaults": bounded(0, 10),
131+
"MajorPageFaults": bounded(0, expectedMajorPageFaultsUpperBound),
127132
})
128133
runtimeContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
129134
if systemdutil.IsRunningSystemd() && framework.TestContext.ContainerRuntime == "docker" {

vendor/github.com/google/cadvisor/container/common/helpers.go

+100-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/google/cadvisor/container/libcontainer/handler.go

+10-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)