Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ff85f0ba
Commit
ff85f0ba
authored
Oct 02, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14698 from yujuhong/gce_only
Auto commit by PR queue bot
parents
171ce57c
15cdc45b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
45 deletions
+72
-45
e2e.sh
hack/jenkins/e2e.sh
+10
-0
kubelet_perf.go
test/e2e/kubelet_perf.go
+62
-45
No files found.
hack/jenkins/e2e.sh
View file @
ff85f0ba
...
...
@@ -112,8 +112,14 @@ GKE_REQUIRED_SKIP_TESTS=(
"Shell"
"Daemon
\s
set"
"Deployment"
"experimental
\s
resource
\s
usage
\s
tracking"
# Expect --max-pods=100
)
# Tests which cannot be run on AWS.
AWS_REQUIRED_SKIP_TESTS
=(
"experimental
\s
resource
\s
usage
\s
tracking"
# Expect --max-pods=100
)
# The following tests are known to be flaky, and are thus run only in their own
# -flaky- build variants.
GCE_FLAKY_TESTS
=(
...
...
@@ -301,6 +307,7 @@ case ${JOB_NAME} in
${
GCE_PARALLEL_SKIP_TESTS
[@]
:+
${
GCE_PARALLEL_SKIP_TESTS
[@]
}}
\
${
GCE_FLAKY_TESTS
[@]
:+
${
GCE_FLAKY_TESTS
[@]
}}
\
${
GCE_PARALLEL_FLAKY_TESTS
[@]
:+
${
GCE_PARALLEL_FLAKY_TESTS
[@]
}}
\
${
AWS_REQUIRED_SKIP_TESTS
[@]
:+
${
AWS_REQUIRED_SKIP_TESTS
[@]
}}
\
)
"
}
:
${
ENABLE_DEPLOYMENTS
:
=true
}
# Override AWS defaults.
...
...
@@ -439,6 +446,7 @@ case ${JOB_NAME} in
${
GKE_REQUIRED_SKIP_TESTS
[@]
:+
${
GKE_REQUIRED_SKIP_TESTS
[@]
}}
\
${
GCE_DEFAULT_SKIP_TESTS
[@]
:+
${
GCE_DEFAULT_SKIP_TESTS
[@]
}}
\
${
GCE_FLAKY_TESTS
[@]
:+
${
GCE_FLAKY_TESTS
[@]
}}
\
${
GCE_SLOW_TESTS
[@]
:+
${
GCE_SLOW_TESTS
[@]
}}
\
)
"
}
;;
...
...
@@ -455,6 +463,7 @@ case ${JOB_NAME} in
${
REBOOT_SKIP_TESTS
[@]
:+
${
REBOOT_SKIP_TESTS
[@]
}}
\
${
GCE_FLAKY_TESTS
[@]
:+
${
GCE_FLAKY_TESTS
[@]
}}
\
${
GCE_PARALLEL_SKIP_TESTS
[@]
:+
${
GCE_PARALLEL_SKIP_TESTS
[@]
}}
\
${
GCE_SLOW_TESTS
[@]
:+
${
GCE_SLOW_TESTS
[@]
}}
\
)
"
}
;;
...
...
@@ -560,6 +569,7 @@ case ${JOB_NAME} in
${
GKE_REQUIRED_SKIP_TESTS
[@]
:+
${
GKE_REQUIRED_SKIP_TESTS
[@]
}}
\
${
GCE_DEFAULT_SKIP_TESTS
[@]
:+
${
GCE_DEFAULT_SKIP_TESTS
[@]
}}
\
${
GCE_FLAKY_TESTS
[@]
:+
${
GCE_FLAKY_TESTS
[@]
}}
\
${
GCE_SLOW_TESTS
[@]
:+
${
GCE_SLOW_TESTS
[@]
}}
\
)
"
}
;;
...
...
test/e2e/kubelet_perf.go
View file @
ff85f0ba
...
...
@@ -50,8 +50,55 @@ func logPodsOnNodes(c *client.Client, nodeNames []string) {
}
}
func
runResourceTrackingTest
(
framework
*
Framework
,
podsPerNode
int
,
nodeNames
sets
.
String
,
resourceMonitor
*
resourceMonitor
)
{
numNodes
:=
nodeNames
.
Len
()
totalPods
:=
podsPerNode
*
numNodes
By
(
fmt
.
Sprintf
(
"Creating a RC of %d pods and wait until all pods of this RC are running"
,
totalPods
))
rcName
:=
fmt
.
Sprintf
(
"resource%d-%s"
,
totalPods
,
string
(
util
.
NewUUID
()))
// TODO: Use a more realistic workload
Expect
(
RunRC
(
RCConfig
{
Client
:
framework
.
Client
,
Name
:
rcName
,
Namespace
:
framework
.
Namespace
.
Name
,
Image
:
"gcr.io/google_containers/pause:go"
,
Replicas
:
totalPods
,
}))
.
NotTo
(
HaveOccurred
())
// Log once and flush the stats.
resourceMonitor
.
LogLatest
()
resourceMonitor
.
Reset
()
By
(
"Start monitoring resource usage"
)
// Periodically dump the cpu summary until the deadline is met.
// Note that without calling resourceMonitor.Reset(), the stats
// would occupy increasingly more memory. This should be fine
// for the current test duration, but we should reclaim the
// entries if we plan to monitor longer (e.g., 8 hours).
deadline
:=
time
.
Now
()
.
Add
(
monitoringTime
)
for
time
.
Now
()
.
Before
(
deadline
)
{
Logf
(
"Still running...%v left"
,
deadline
.
Sub
(
time
.
Now
()))
time
.
Sleep
(
reportingPeriod
)
timeLeft
:=
deadline
.
Sub
(
time
.
Now
())
Logf
(
"Still running...%v left"
,
timeLeft
)
if
timeLeft
<
reportingPeriod
{
time
.
Sleep
(
timeLeft
)
}
else
{
time
.
Sleep
(
reportingPeriod
)
}
logPodsOnNodes
(
framework
.
Client
,
nodeNames
.
List
())
}
By
(
"Reporting overall resource usage"
)
logPodsOnNodes
(
framework
.
Client
,
nodeNames
.
List
())
resourceMonitor
.
LogCPUSummary
()
resourceMonitor
.
LogLatest
()
By
(
"Deleting the RC"
)
DeleteRC
(
framework
.
Client
,
framework
.
Namespace
.
Name
,
rcName
)
}
var
_
=
Describe
(
"Kubelet"
,
func
()
{
var
numNodes
int
var
nodeNames
sets
.
String
framework
:=
NewFramework
(
"kubelet-perf"
)
var
resourceMonitor
*
resourceMonitor
...
...
@@ -59,7 +106,6 @@ var _ = Describe("Kubelet", func() {
BeforeEach
(
func
()
{
nodes
,
err
:=
framework
.
Client
.
Nodes
()
.
List
(
labels
.
Everything
(),
fields
.
Everything
())
expectNoError
(
err
)
numNodes
=
len
(
nodes
.
Items
)
nodeNames
=
sets
.
NewString
()
for
_
,
node
:=
range
nodes
.
Items
{
nodeNames
.
Insert
(
node
.
Name
)
...
...
@@ -72,54 +118,25 @@ var _ = Describe("Kubelet", func() {
resourceMonitor
.
Stop
()
})
Describe
(
"resource usage tracking"
,
func
()
{
density
:=
[]
int
{
0
,
50
}
Describe
(
"regular resource usage tracking"
,
func
()
{
density
:=
[]
int
{
0
,
35
}
for
i
:=
range
density
{
podsPerNode
:=
density
[
i
]
name
:=
fmt
.
Sprintf
(
"over %v with %d pods per node."
,
monitoringTime
,
podsPerNode
)
It
(
name
,
func
()
{
runResourceTrackingTest
(
framework
,
podsPerNode
,
nodeNames
,
resourceMonitor
)
})
}
})
Describe
(
"experimental resource usage tracking"
,
func
()
{
density
:=
[]
int
{
50
}
for
i
:=
range
density
{
podsPerNode
:=
density
[
i
]
name
:=
fmt
.
Sprintf
(
"over %v with %d pods per node."
,
monitoringTime
,
podsPerNode
)
It
(
name
,
func
()
{
// Skip this test for GKE.
// TODO: Re-activate this for GKE
SkipIfProviderIs
(
"gke"
)
totalPods
:=
podsPerNode
*
numNodes
By
(
fmt
.
Sprintf
(
"Creating a RC of %d pods and wait until all pods of this RC are running"
,
totalPods
))
rcName
:=
fmt
.
Sprintf
(
"resource%d-%s"
,
totalPods
,
string
(
util
.
NewUUID
()))
// TODO: Use a more realistic workload
Expect
(
RunRC
(
RCConfig
{
Client
:
framework
.
Client
,
Name
:
rcName
,
Namespace
:
framework
.
Namespace
.
Name
,
Image
:
"gcr.io/google_containers/pause:go"
,
Replicas
:
totalPods
,
}))
.
NotTo
(
HaveOccurred
())
// Log once and flush the stats.
resourceMonitor
.
LogLatest
()
resourceMonitor
.
Reset
()
By
(
"Start monitoring resource usage"
)
// Periodically dump the cpu summary until the deadline is met.
// Note that without calling resourceMonitor.Reset(), the stats
// would occupy increasingly more memory. This should be fine
// for the current test duration, but we should reclaim the
// entries if we plan to monitor longer (e.g., 8 hours).
deadline
:=
time
.
Now
()
.
Add
(
monitoringTime
)
for
time
.
Now
()
.
Before
(
deadline
)
{
Logf
(
"Still running...%v left"
,
deadline
.
Sub
(
time
.
Now
()))
time
.
Sleep
(
reportingPeriod
)
logPodsOnNodes
(
framework
.
Client
,
nodeNames
.
List
())
}
By
(
"Reporting overall resource usage"
)
logPodsOnNodes
(
framework
.
Client
,
nodeNames
.
List
())
resourceMonitor
.
LogCPUSummary
()
resourceMonitor
.
LogLatest
()
By
(
"Deleting the RC"
)
DeleteRC
(
framework
.
Client
,
framework
.
Namespace
.
Name
,
rcName
)
runResourceTrackingTest
(
framework
,
podsPerNode
,
nodeNames
,
resourceMonitor
)
})
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment