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
8cabbcbd
Commit
8cabbcbd
authored
Jul 01, 2016
by
Piotr Szczesniak
Committed by
GitHub
Jul 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #28344 from mwielgus/e2e-sd-nanp
E2e tests to check whether cluster autoscaling scale down works when one node pool is not autoscaled
parents
34244efd
92b3359a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
cluster_size_autoscaling.go
test/e2e/cluster_size_autoscaling.go
+31
-5
No files found.
test/e2e/cluster_size_autoscaling.go
View file @
8cabbcbd
...
@@ -137,7 +137,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -137,7 +137,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
const
extraPoolName
=
"extra-pool"
const
extraPoolName
=
"extra-pool"
addNodePool
(
extraPoolName
,
"n1-standard-4"
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
defer
deleteNodePool
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
...
@@ -156,7 +156,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -156,7 +156,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
const
extraPoolName
=
"extra-pool"
const
extraPoolName
=
"extra-pool"
addNodePool
(
extraPoolName
,
"n1-standard-4"
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
defer
deleteNodePool
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
...
@@ -225,7 +225,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -225,7 +225,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
By
(
"Creating new node-pool with one n1-standard-4 machine"
)
const
extraPoolName
=
"extra-pool"
const
extraPoolName
=
"extra-pool"
addNodePool
(
extraPoolName
,
"n1-standard-4"
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
defer
deleteNodePool
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
...
@@ -252,6 +252,32 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -252,6 +252,32 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
func
(
size
int
)
bool
{
return
size
<
increasedSize
},
scaleDownTimeout
))
func
(
size
int
)
bool
{
return
size
<
increasedSize
},
scaleDownTimeout
))
})
})
It
(
"should correctly scale down after a node is not needed when there is non autoscaled pool[Feature:ClusterSizeAutoscalingScaleDown]"
,
func
()
{
framework
.
SkipUnlessProviderIs
(
"gke"
)
By
(
"Manually increase cluster size"
)
increasedSize
:=
0
newSizes
:=
make
(
map
[
string
]
int
)
for
key
,
val
:=
range
originalSizes
{
newSizes
[
key
]
=
val
+
2
increasedSize
+=
val
+
2
}
setMigSizes
(
newSizes
)
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
func
(
size
int
)
bool
{
return
size
>=
increasedSize
},
scaleUpTimeout
))
const
extraPoolName
=
"extra-pool"
addNodePool
(
extraPoolName
,
"n1-standard-1"
,
3
)
defer
deleteNodePool
(
extraPoolName
)
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
func
(
size
int
)
bool
{
return
size
>=
increasedSize
+
3
},
scaleUpTimeout
))
By
(
"Some node should be removed"
)
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
func
(
size
int
)
bool
{
return
size
<
increasedSize
+
3
},
scaleDownTimeout
))
})
})
})
func
getGKEClusterUrl
()
string
{
func
getGKEClusterUrl
()
string
{
...
@@ -378,10 +404,10 @@ func disableAutoscaler(nodePool string, minCount, maxCount int) error {
...
@@ -378,10 +404,10 @@ func disableAutoscaler(nodePool string, minCount, maxCount int) error {
return
fmt
.
Errorf
(
"autoscaler still enabled"
)
return
fmt
.
Errorf
(
"autoscaler still enabled"
)
}
}
func
addNodePool
(
name
string
,
machineType
string
)
{
func
addNodePool
(
name
string
,
machineType
string
,
numNodes
int
)
{
output
,
err
:=
exec
.
Command
(
"gcloud"
,
"alpha"
,
"container"
,
"node-pools"
,
"create"
,
name
,
"--quiet"
,
output
,
err
:=
exec
.
Command
(
"gcloud"
,
"alpha"
,
"container"
,
"node-pools"
,
"create"
,
name
,
"--quiet"
,
"--machine-type="
+
machineType
,
"--machine-type="
+
machineType
,
"--num-nodes=
1"
,
"--num-nodes=
"
+
strconv
.
Itoa
(
numNodes
)
,
"--project="
+
framework
.
TestContext
.
CloudConfig
.
ProjectID
,
"--project="
+
framework
.
TestContext
.
CloudConfig
.
ProjectID
,
"--zone="
+
framework
.
TestContext
.
CloudConfig
.
Zone
,
"--zone="
+
framework
.
TestContext
.
CloudConfig
.
Zone
,
"--cluster="
+
framework
.
TestContext
.
CloudConfig
.
Cluster
)
.
CombinedOutput
()
"--cluster="
+
framework
.
TestContext
.
CloudConfig
.
Cluster
)
.
CombinedOutput
()
...
...
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