From 402266afde3955cc3f7a16de4bb3e7b00e8a3fb7 Mon Sep 17 00:00:00 2001 From: Chris O'Haver Date: Mon, 15 Oct 2018 11:45:41 -0400 Subject: [PATCH] add dns pod memory constraint --- test/e2e/framework/resource_usage_gatherer.go | 2 ++ test/e2e/scalability/density.go | 8 ++++++++ test/e2e/scalability/load.go | 15 +++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/test/e2e/framework/resource_usage_gatherer.go b/test/e2e/framework/resource_usage_gatherer.go index 93aa16a412c..c7d6874a37e 100644 --- a/test/e2e/framework/resource_usage_gatherer.go +++ b/test/e2e/framework/resource_usage_gatherer.go @@ -48,6 +48,8 @@ type SingleContainerSummary struct { // we can't have int here, as JSON does not accept integer keys. type ResourceUsageSummary map[string][]SingleContainerSummary +const NoCPUConstraint = math.MaxFloat64 + func (s *ResourceUsageSummary) PrintHumanReadable() string { buf := &bytes.Buffer{} w := tabwriter.NewWriter(buf, 1, 0, 1, ' ', 0) diff --git a/test/e2e/scalability/density.go b/test/e2e/scalability/density.go index 69ab8d2e508..67d9a9235c7 100644 --- a/test/e2e/scalability/density.go +++ b/test/e2e/scalability/density.go @@ -224,6 +224,14 @@ func density30AddonResourceVerifier(numNodes int) map[string]framework.ResourceC CPUConstraint: schedulerCPU, MemoryConstraint: schedulerMem, } + constraints["coredns"] = framework.ResourceConstraint{ + CPUConstraint: framework.NoCPUConstraint, + MemoryConstraint: 170 * (1024 * 1024), + } + constraints["kubedns"] = framework.ResourceConstraint{ + CPUConstraint: framework.NoCPUConstraint, + MemoryConstraint: 170 * (1024 * 1024), + } return constraints } diff --git a/test/e2e/scalability/load.go b/test/e2e/scalability/load.go index 3f528c229cc..78d3d45c55c 100644 --- a/test/e2e/scalability/load.go +++ b/test/e2e/scalability/load.go @@ -232,6 +232,8 @@ var _ = SIGDescribe("Load capacity", func() { framework.ExpectNoError(CreateQuotas(f, namespaces, 2*totalPods, testPhaseDurations.StartPhase(115, "quota creation"))) } + f.AddonResourceConstraints = loadResourceConstraints() + serviceCreationPhase := testPhaseDurations.StartPhase(120, "services creation") defer serviceCreationPhase.End() if itArg.services { @@ -429,6 +431,19 @@ func computePodCounts(total int) (int, int, int) { return smallGroupCount, mediumGroupCount, bigGroupCount } +func loadResourceConstraints() map[string]framework.ResourceConstraint { + constraints := make(map[string]framework.ResourceConstraint) + constraints["coredns"] = framework.ResourceConstraint{ + CPUConstraint: framework.NoCPUConstraint, + MemoryConstraint: 170 * (1024 * 1024), + } + constraints["kubedns"] = framework.ResourceConstraint{ + CPUConstraint: framework.NoCPUConstraint, + MemoryConstraint: 170 * (1024 * 1024), + } + return constraints +} + func generateConfigs( totalPods int, image string,