Add a slow e2e test to monitor kubelet resource usage

This test tracks kubelet resource usage over a long period of time (1hr)
when running N pods (e.g., N=0,50), and prints out the resource usage. This
would give us an idea how much kubelet's management overhead is in a stable
cluster.

Some followup items:
 * Use a more realistic workload (e.g., including probing)
 * Fail the test if the resource usage is too high.

Caveat:
 * We assume the scheduler would do a decent job distributing the pause pods,
   but we should double check.
 * Cluster addon pods could be unevenly distributed and skews the resource
   usage on nodes.
This commit is contained in:
Yu-Ju Hong
2015-09-22 16:38:36 -07:00
parent ab85b9a7d6
commit 0b8244505c
4 changed files with 131 additions and 18 deletions

View File

@@ -37,7 +37,6 @@ const (
pollInterval = 1 * time.Second
// Interval to poll /stats/container on a node
containerStatsPollingInterval = 5 * time.Second
resourceCollectionTime = 1 * time.Minute
)
// getPodMatches returns a set of pod names on the given node that matches the
@@ -160,16 +159,4 @@ var _ = Describe("kubelet", func() {
})
}
})
Describe("Monitor resource usage on node", func() {
It("Ask kubelet to report container resource usage", func() {
// TODO: After gathering some numbers, we should set a resource
// limit for each container and fail the test if the usage exceeds
// the preset limit.
By(fmt.Sprintf("Waiting %v to collect resource usage on node", resourceCollectionTime))
time.Sleep(resourceCollectionTime)
resourceMonitor.LogLatest()
resourceMonitor.LogCPUSummary()
})
})
})