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
b3348c32
Commit
b3348c32
authored
Oct 02, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14560 from piosz/requests-test
Auto commit by PR queue bot
parents
ffacd3bc
67e5aca7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
34 deletions
+26
-34
autoscaling.go
test/e2e/autoscaling.go
+26
-34
No files found.
test/e2e/autoscaling.go
View file @
b3348c32
...
@@ -65,13 +65,13 @@ var _ = Describe("Autoscaling", func() {
...
@@ -65,13 +65,13 @@ var _ = Describe("Autoscaling", func() {
})
})
It
(
"[Skipped] should scale cluster size based on cpu reservation"
,
func
()
{
It
(
"[Skipped] should scale cluster size based on cpu reservation"
,
func
()
{
setUpAutoscaler
(
"cpu/node_reservation"
,
0.
7
,
1
,
10
)
setUpAutoscaler
(
"cpu/node_reservation"
,
0.
5
,
nodeCount
,
nodeCount
+
1
)
ReserveCpu
(
f
,
"cpu-reservation"
,
800
)
ReserveCpu
(
f
,
"cpu-reservation"
,
600
*
nodeCount
*
coresPerNode
)
expectNoError
(
waitForClusterSize
(
f
.
Client
,
2
,
20
*
time
.
Minute
))
expectNoError
(
waitForClusterSize
(
f
.
Client
,
nodeCount
+
1
,
20
*
time
.
Minute
))
StopConsuming
(
f
,
"cpu-reservation"
)
expectNoError
(
DeleteRC
(
f
.
Client
,
f
.
Namespace
.
Name
,
"cpu-reservation"
)
)
expectNoError
(
waitForClusterSize
(
f
.
Client
,
1
,
20
*
time
.
Minute
))
expectNoError
(
waitForClusterSize
(
f
.
Client
,
nodeCount
,
20
*
time
.
Minute
))
})
})
It
(
"[Skipped][Autoscaling Suite] should scale cluster size based on memory utilization"
,
func
()
{
It
(
"[Skipped][Autoscaling Suite] should scale cluster size based on memory utilization"
,
func
()
{
...
@@ -87,13 +87,13 @@ var _ = Describe("Autoscaling", func() {
...
@@ -87,13 +87,13 @@ var _ = Describe("Autoscaling", func() {
})
})
It
(
"[Skipped] should scale cluster size based on memory reservation"
,
func
()
{
It
(
"[Skipped] should scale cluster size based on memory reservation"
,
func
()
{
setUpAutoscaler
(
"memory/node_reservation"
,
0.5
,
1
,
10
)
setUpAutoscaler
(
"memory/node_reservation"
,
0.5
,
nodeCount
,
nodeCount
+
1
)
ReserveMemory
(
f
,
"memory-reservation"
,
2
)
ReserveMemory
(
f
,
"memory-reservation"
,
nodeCount
*
memCapacityMb
*
6
/
10
)
expectNoError
(
waitForClusterSize
(
f
.
Client
,
2
,
20
*
time
.
Minute
))
expectNoError
(
waitForClusterSize
(
f
.
Client
,
nodeCount
+
1
,
20
*
time
.
Minute
))
StopConsuming
(
f
,
"memory-reservation"
)
expectNoError
(
DeleteRC
(
f
.
Client
,
f
.
Namespace
.
Name
,
"memory-reservation"
)
)
expectNoError
(
waitForClusterSize
(
f
.
Client
,
1
,
20
*
time
.
Minute
))
expectNoError
(
waitForClusterSize
(
f
.
Client
,
nodeCount
,
20
*
time
.
Minute
))
})
})
})
})
...
@@ -124,35 +124,27 @@ func cleanUpAutoscaler() {
...
@@ -124,35 +124,27 @@ func cleanUpAutoscaler() {
func
ReserveCpu
(
f
*
Framework
,
id
string
,
millicores
int
)
{
func
ReserveCpu
(
f
*
Framework
,
id
string
,
millicores
int
)
{
By
(
fmt
.
Sprintf
(
"Running RC which reserves %v millicores"
,
millicores
))
By
(
fmt
.
Sprintf
(
"Running RC which reserves %v millicores"
,
millicores
))
config
:=
&
RCConfig
{
config
:=
&
RCConfig
{
Client
:
f
.
Client
,
Client
:
f
.
Client
,
Name
:
id
,
Name
:
id
,
Namespace
:
f
.
Namespace
.
Name
,
Namespace
:
f
.
Namespace
.
Name
,
Timeout
:
10
*
time
.
Minute
,
Timeout
:
10
*
time
.
Minute
,
Image
:
"gcr.io/google_containers/pause"
,
Image
:
"gcr.io/google_containers/pause"
,
Replicas
:
millicores
/
100
,
Replicas
:
millicores
/
100
,
Cpu
Limit
:
100
,
Cpu
Request
:
100
,
}
}
expectNoError
(
RunRC
(
*
config
))
expectNoError
(
RunRC
(
*
config
))
}
}
func
ReserveMemory
(
f
*
Framework
,
id
string
,
gi
gabytes
int
)
{
func
ReserveMemory
(
f
*
Framework
,
id
string
,
me
gabytes
int
)
{
By
(
fmt
.
Sprintf
(
"Running RC which reserves %v
GB of memory"
,
gi
gabytes
))
By
(
fmt
.
Sprintf
(
"Running RC which reserves %v
MB of memory"
,
me
gabytes
))
config
:=
&
RCConfig
{
config
:=
&
RCConfig
{
Client
:
f
.
Client
,
Client
:
f
.
Client
,
Name
:
id
,
Name
:
id
,
Namespace
:
f
.
Namespace
.
Name
,
Namespace
:
f
.
Namespace
.
Name
,
Timeout
:
10
*
time
.
Minute
,
Timeout
:
10
*
time
.
Minute
,
Image
:
"gcr.io/google_containers/pause"
,
Image
:
"gcr.io/google_containers/pause"
,
Replicas
:
5
*
gigabytes
,
Replicas
:
megabytes
/
500
,
Mem
Limit
:
2
00
*
1024
*
1024
,
Mem
Request
:
5
00
*
1024
*
1024
,
}
}
expectNoError
(
RunRC
(
*
config
))
expectNoError
(
RunRC
(
*
config
))
}
}
func
StopConsuming
(
f
*
Framework
,
id
string
)
{
By
(
"Stopping service "
+
id
)
err
:=
f
.
Client
.
Services
(
f
.
Namespace
.
Name
)
.
Delete
(
id
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"Stopping RC "
+
id
)
expectNoError
(
DeleteRC
(
f
.
Client
,
f
.
Namespace
.
Name
,
id
))
}
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