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
fe4aa959
Commit
fe4aa959
authored
Feb 21, 2018
by
Beata Skiba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure node pool is deleted in autoscaler e2e tests.
Currently, if node pool creation succeeds, but we fail to get initial pool size, the node pool does not get deleted.
parent
89156e7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+12
-8
No files found.
test/e2e/autoscaling/cluster_size_autoscaling.go
View file @
fe4aa959
...
...
@@ -248,8 +248,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with n1-standard-4 machines"
)
const
extraPoolName
=
"extra-pool"
extraNodes
:=
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
extraNodes
:=
getPoolInitialSize
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForReadyNodes
(
c
,
nodeCount
+
extraNodes
,
resizeTimeout
))
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
...
...
@@ -278,8 +279,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with n1-standard-4 machines"
)
const
extraPoolName
=
"extra-pool"
extraNodes
:=
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
extraNodes
:=
getPoolInitialSize
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForReadyNodes
(
c
,
nodeCount
+
extraNodes
,
resizeTimeout
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
framework
.
ExpectNoError
(
disableAutoscaler
(
extraPoolName
,
1
,
2
))
...
...
@@ -512,8 +514,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
By
(
"Creating new node-pool with n1-standard-4 machines"
)
const
extraPoolName
=
"extra-pool"
extraNodes
:=
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
extraNodes
:=
getPoolInitialSize
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForReadyNodes
(
c
,
nodeCount
+
extraNodes
,
resizeTimeout
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
1
,
2
))
defer
disableAutoscaler
(
extraPoolName
,
1
,
2
)
...
...
@@ -566,8 +569,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
increasedSize
:=
manuallyIncreaseClusterSize
(
f
,
originalSizes
)
const
extraPoolName
=
"extra-pool"
extraNodes
:=
addNodePool
(
extraPoolName
,
"n1-standard-1"
,
3
)
addNodePool
(
extraPoolName
,
"n1-standard-1"
,
3
)
defer
deleteNodePool
(
extraPoolName
)
extraNodes
:=
getPoolInitialSize
(
extraPoolName
)
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
func
(
size
int
)
bool
{
return
size
>=
increasedSize
+
extraNodes
},
scaleUpTimeout
))
...
...
@@ -681,8 +685,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
// GKE-specific setup
By
(
"Add a new node pool with size 1 and min size 0"
)
const
extraPoolName
=
"extra-pool"
extraNodes
:=
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
addNodePool
(
extraPoolName
,
"n1-standard-4"
,
1
)
defer
deleteNodePool
(
extraPoolName
)
extraNodes
:=
getPoolInitialSize
(
extraPoolName
)
framework
.
ExpectNoError
(
framework
.
WaitForReadyNodes
(
c
,
nodeCount
+
extraNodes
,
resizeTimeout
))
framework
.
ExpectNoError
(
enableAutoscaler
(
extraPoolName
,
0
,
1
))
defer
disableAutoscaler
(
extraPoolName
,
0
,
1
)
...
...
@@ -1286,15 +1291,14 @@ func waitTillAllNAPNodePoolsAreRemoved() error {
}
// Returns size of the newly added node pool
func
addNodePool
(
name
string
,
machineType
string
,
numNodes
int
)
int
{
func
addNodePool
(
name
string
,
machineType
string
,
numNodes
int
)
{
args
:=
[]
string
{
"container"
,
"node-pools"
,
"create"
,
name
,
"--quiet"
,
"--machine-type="
+
machineType
,
"--num-nodes="
+
strconv
.
Itoa
(
numNodes
),
"--cluster="
+
framework
.
TestContext
.
CloudConfig
.
Cluster
}
output
,
err
:=
execCmd
(
getGcloudCommand
(
args
)
...
)
.
CombinedOutput
()
glog
.
Infof
(
"Creating node-pool %s: %s"
,
name
,
output
)
framework
.
ExpectNoError
(
err
)
return
getPoolInitialSize
(
name
)
framework
.
ExpectNoError
(
err
,
output
)
}
func
deleteNodePool
(
name
string
)
{
...
...
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