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
f53be7bd
Commit
f53be7bd
authored
Jun 28, 2017
by
Maciej Pytel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix condition in autoscaler e2e
Fix off-by-one in cluster-autoscaler that made the test trivially pass (without actually requiring scale-up to happen).
parent
ba2bdb1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+11
-2
No files found.
test/e2e/autoscaling/cluster_size_autoscaling.go
View file @
f53be7bd
...
...
@@ -229,12 +229,20 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
+
1
,
resizeTimeout
))
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
ReserveMemory
(
f
,
"memory-reservation"
,
100
,
nodeCount
*
memCapacityMb
,
false
,
defaultTimeout
)
By
(
"Get memory available on new node, so we can account for it when creating RC"
)
nodes
,
err
:=
framework
.
GetGroupNodes
(
extraPoolName
)
framework
.
ExpectNoError
(
err
)
Expect
(
len
(
nodes
))
.
Should
(
Equal
(
1
))
node
,
err
:=
f
.
ClientSet
.
Core
()
.
Nodes
()
.
Get
(
nodes
[
0
],
metav1
.
GetOptions
{})
extraMem
:=
node
.
Status
.
Capacity
[
v1
.
ResourceMemory
]
extraMemMb
:=
int
((
&
extraMem
)
.
Value
()
/
1024
/
1024
)
ReserveMemory
(
f
,
"memory-reservation"
,
100
,
nodeCount
*
memCapacityMb
+
extraMemMb
,
false
,
defaultTimeout
)
defer
framework
.
DeleteRCAndPods
(
f
.
ClientSet
,
f
.
InternalClientset
,
f
.
Namespace
.
Name
,
"memory-reservation"
)
// Verify, that cluster size is increased
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
1
},
scaleUpTimeout
))
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
2
},
scaleUpTimeout
))
framework
.
ExpectNoError
(
waitForAllCaPodsReadyInNamespace
(
f
,
c
))
})
...
...
@@ -586,6 +594,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
nodes
,
err
:=
f
.
ClientSet
.
Core
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
"spec.unschedulable"
:
"false"
,
}
.
AsSelector
()
.
String
()})
framework
.
ExpectNoError
(
err
)
for
_
,
node
:=
range
nodes
.
Items
{
err
=
makeNodeUnschedulable
(
f
.
ClientSet
,
&
node
)
...
...
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