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
158ffdb1
Commit
158ffdb1
authored
Sep 14, 2017
by
Aleksandra Malinowska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get nodes from GKE node pool by checking labels
parent
1bdcfa59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+13
-4
No files found.
test/e2e/autoscaling/cluster_size_autoscaling.go
View file @
158ffdb1
...
@@ -230,11 +230,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -230,11 +230,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
glog
.
Infof
(
"Not enabling cluster autoscaler for the node pool (on purpose)."
)
By
(
"Get memory available on new node, so we can account for it when creating RC"
)
By
(
"Get memory available on new node, so we can account for it when creating RC"
)
nodes
,
err
:=
framework
.
GetGroupNodes
(
extraPoolName
)
nodes
:=
getPoolNodes
(
f
,
extraPoolName
)
framework
.
ExpectNoError
(
err
)
Expect
(
len
(
nodes
))
.
Should
(
Equal
(
1
))
Expect
(
len
(
nodes
))
.
Should
(
Equal
(
1
))
node
,
err
:=
f
.
ClientSet
.
Core
()
.
Nodes
()
.
Get
(
nodes
[
0
],
metav1
.
GetOptions
{})
extraMem
:=
nodes
[
0
]
.
Status
.
Capacity
[
v1
.
ResourceMemory
]
extraMem
:=
node
.
Status
.
Capacity
[
v1
.
ResourceMemory
]
extraMemMb
:=
int
((
&
extraMem
)
.
Value
()
/
1024
/
1024
)
extraMemMb
:=
int
((
&
extraMem
)
.
Value
()
/
1024
/
1024
)
ReserveMemory
(
f
,
"memory-reservation"
,
100
,
nodeCount
*
memCapacityMb
+
extraMemMb
,
false
,
defaultTimeout
)
ReserveMemory
(
f
,
"memory-reservation"
,
100
,
nodeCount
*
memCapacityMb
+
extraMemMb
,
false
,
defaultTimeout
)
...
@@ -890,6 +888,17 @@ func deleteNodePool(name string) {
...
@@ -890,6 +888,17 @@ func deleteNodePool(name string) {
glog
.
Infof
(
"Node-pool deletion output: %s"
,
output
)
glog
.
Infof
(
"Node-pool deletion output: %s"
,
output
)
}
}
func
getPoolNodes
(
f
*
framework
.
Framework
,
poolName
string
)
[]
*
v1
.
Node
{
nodes
:=
make
([]
*
v1
.
Node
,
0
,
1
)
nodeList
:=
framework
.
GetReadySchedulableNodesOrDie
(
f
.
ClientSet
)
for
_
,
node
:=
range
nodeList
.
Items
{
if
poolLabel
:=
node
.
Labels
[
"cloud.google.com/gke-nodepool"
];
poolLabel
==
poolName
{
nodes
=
append
(
nodes
,
&
node
)
}
}
return
nodes
}
func
doPut
(
url
,
content
string
)
(
string
,
error
)
{
func
doPut
(
url
,
content
string
)
(
string
,
error
)
{
req
,
err
:=
http
.
NewRequest
(
"PUT"
,
url
,
bytes
.
NewBuffer
([]
byte
(
content
)))
req
,
err
:=
http
.
NewRequest
(
"PUT"
,
url
,
bytes
.
NewBuffer
([]
byte
(
content
)))
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
...
...
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