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
905382f7
Commit
905382f7
authored
May 17, 2016
by
Jerzy Szczepkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added e2e test for cluster autoscaler that verifies host ports.
Added e2e test for cluster autoscaler that verifies host ports.
parent
1738bbfe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
+33
-6
cluster_size_autoscaling.go
test/e2e/cluster_size_autoscaling.go
+29
-2
resize_nodes.go
test/e2e/resize_nodes.go
+4
-4
No files found.
test/e2e/cluster_size_autoscaling.go
View file @
905382f7
...
...
@@ -65,11 +65,38 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Feature:ClusterSizeAut
// Verify, that cluster size is increased
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
f
.
Client
,
nodeCount
+
1
,
scaleTimeout
))
framework
.
ExpectNoError
(
framework
.
DeleteRC
(
f
.
Client
,
f
.
Namespace
.
Name
,
"memory-reservation"
))
// TODO(jsz): Enable code bellow when scale down is implemented.
// framework.ExpectNoError(framework.WaitForClusterSize(f.Client, nodeCount, scaleDownTimeout))
// TODO(jsz): Disable the line bellow when scale down is implemented.
framework
.
ExpectNoError
(
ResizeGroup
(
int32
(
nodeCount
)))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
f
.
Client
,
nodeCount
,
scaleTimeout
))
By
(
"Handling node port pods"
)
CreateHostPortPods
(
f
,
"host-port"
,
nodeCount
+
2
,
false
)
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
f
.
Client
,
nodeCount
+
2
,
scaleTimeout
))
framework
.
ExpectNoError
(
framework
.
DeleteRC
(
f
.
Client
,
f
.
Namespace
.
Name
,
"host-port"
))
// TODO(jsz): Disable the line bellow when scale down is implemented.
framework
.
ExpectNoError
(
ResizeGroup
(
int32
(
nodeCount
)))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
f
.
Client
,
nodeCount
,
scaleTimeout
))
})
})
func
CreateHostPortPods
(
f
*
framework
.
Framework
,
id
string
,
replicas
int
,
expectRunning
bool
)
{
By
(
fmt
.
Sprintf
(
"Running RC which reserves host port"
))
config
:=
&
framework
.
RCConfig
{
Client
:
f
.
Client
,
Name
:
id
,
Namespace
:
f
.
Namespace
.
Name
,
Timeout
:
scaleTimeout
,
Image
:
"gcr.io/google_containers/pause-amd64:3.0"
,
Replicas
:
replicas
,
HostPorts
:
map
[
string
]
int
{
"port1"
:
4321
},
}
err
:=
framework
.
RunRC
(
*
config
)
if
expectRunning
{
framework
.
ExpectNoError
(
err
)
}
}
func
ReserveCpu
(
f
*
framework
.
Framework
,
id
string
,
replicas
,
millicores
int
)
{
By
(
fmt
.
Sprintf
(
"Running RC which reserves %v millicores"
,
millicores
))
request
:=
int64
(
millicores
/
replicas
)
...
...
test/e2e/resize_nodes.go
View file @
905382f7
...
...
@@ -53,7 +53,7 @@ const (
testPort
=
9376
)
func
r
esizeGroup
(
size
int32
)
error
{
func
R
esizeGroup
(
size
int32
)
error
{
if
framework
.
TestContext
.
ReportDir
!=
""
{
framework
.
CoreDump
(
framework
.
TestContext
.
ReportDir
)
defer
framework
.
CoreDump
(
framework
.
TestContext
.
ReportDir
)
...
...
@@ -371,7 +371,7 @@ var _ = framework.KubeDescribe("Nodes [Disruptive]", func() {
}
By
(
"restoring the original node instance group size"
)
if
err
:=
r
esizeGroup
(
int32
(
framework
.
TestContext
.
CloudConfig
.
NumNodes
));
err
!=
nil
{
if
err
:=
R
esizeGroup
(
int32
(
framework
.
TestContext
.
CloudConfig
.
NumNodes
));
err
!=
nil
{
framework
.
Failf
(
"Couldn't restore the original node instance group size: %v"
,
err
)
}
// In GKE, our current tunneling setup has the potential to hold on to a broken tunnel (from a
...
...
@@ -410,7 +410,7 @@ var _ = framework.KubeDescribe("Nodes [Disruptive]", func() {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
fmt
.
Sprintf
(
"decreasing cluster size to %d"
,
replicas
-
1
))
err
=
r
esizeGroup
(
replicas
-
1
)
err
=
R
esizeGroup
(
replicas
-
1
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
err
=
waitForGroupSize
(
replicas
-
1
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
@@ -434,7 +434,7 @@ var _ = framework.KubeDescribe("Nodes [Disruptive]", func() {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
fmt
.
Sprintf
(
"increasing cluster size to %d"
,
replicas
+
1
))
err
=
r
esizeGroup
(
replicas
+
1
)
err
=
R
esizeGroup
(
replicas
+
1
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
err
=
waitForGroupSize
(
replicas
+
1
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
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