Relax 'misc' container memory constraints

This commit is contained in:
Tim St. Clair 2017-03-16 12:08:22 -07:00
parent 9a1236ae20
commit 827dd340d4
No known key found for this signature in database
GPG Key ID: 434D16BCEF479EAB

View File

@ -69,36 +69,50 @@ var _ = framework.KubeDescribe("Summary API", func() {
) )
fsCapacityBounds := bounded(100*mb, 100*gb) fsCapacityBounds := bounded(100*mb, 100*gb)
// Expectations for system containers. // Expectations for system containers.
sysContExpectations := gstruct.MatchAllFields(gstruct.Fields{ sysContExpectations := func() types.GomegaMatcher {
"Name": gstruct.Ignore(), return gstruct.MatchAllFields(gstruct.Fields{
"StartTime": recent(maxStartAge), "Name": gstruct.Ignore(),
"CPU": ptrMatchAllFields(gstruct.Fields{ "StartTime": recent(maxStartAge),
"Time": recent(maxStatsAge), "CPU": ptrMatchAllFields(gstruct.Fields{
"UsageNanoCores": bounded(10000, 2E9), "Time": recent(maxStatsAge),
"UsageCoreNanoSeconds": bounded(10000000, 1E15), "UsageNanoCores": bounded(10000, 2E9),
}), "UsageCoreNanoSeconds": bounded(10000000, 1E15),
"Memory": ptrMatchAllFields(gstruct.Fields{ }),
"Time": recent(maxStatsAge), "Memory": ptrMatchAllFields(gstruct.Fields{
// We don't limit system container memory. "Time": recent(maxStatsAge),
"AvailableBytes": BeNil(), // We don't limit system container memory.
"UsageBytes": bounded(1*mb, 10*gb), "AvailableBytes": BeNil(),
"WorkingSetBytes": bounded(1*mb, 10*gb), "UsageBytes": bounded(1*mb, 10*gb),
"RSSBytes": bounded(1*mb, 1*gb), "WorkingSetBytes": bounded(1*mb, 10*gb),
"PageFaults": bounded(1000, 1E9), "RSSBytes": bounded(1*mb, 1*gb),
"MajorPageFaults": bounded(0, 100000), "PageFaults": bounded(1000, 1E9),
}), "MajorPageFaults": bounded(0, 100000),
"Rootfs": BeNil(), }),
"Logs": BeNil(), "Rootfs": BeNil(),
"UserDefinedMetrics": BeEmpty(), "Logs": BeNil(),
}) "UserDefinedMetrics": BeEmpty(),
})
}
systemContainers := gstruct.Elements{ systemContainers := gstruct.Elements{
"kubelet": sysContExpectations, "kubelet": sysContExpectations(),
"runtime": sysContExpectations, "runtime": sysContExpectations(),
} }
// The Kubelet only manages the 'misc' system container if the host is not running systemd. // The Kubelet only manages the 'misc' system container if the host is not running systemd.
if !systemdutil.IsRunningSystemd() { if !systemdutil.IsRunningSystemd() {
framework.Logf("Host not running systemd; expecting 'misc' system container.") framework.Logf("Host not running systemd; expecting 'misc' system container.")
systemContainers["misc"] = sysContExpectations miscContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
// Misc processes are system-dependent, so relax the memory constraints.
miscContExpectations.Fields["Memory"] = ptrMatchAllFields(gstruct.Fields{
"Time": recent(maxStatsAge),
// We don't limit system container memory.
"AvailableBytes": BeNil(),
"UsageBytes": bounded(100*kb, 10*gb),
"WorkingSetBytes": bounded(100*kb, 10*gb),
"RSSBytes": bounded(100*kb, 1*gb),
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
})
systemContainers["misc"] = miscContExpectations
} }
// Expectations for pods. // Expectations for pods.
podExpectations := gstruct.MatchAllFields(gstruct.Fields{ podExpectations := gstruct.MatchAllFields(gstruct.Fields{