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
da112e23
Commit
da112e23
authored
Jun 06, 2016
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle multiple MIGs (single-zone) properly in GKE scripts.
parent
6c549ae9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
12 deletions
+31
-12
util.sh
cluster/gke/util.sh
+18
-11
util.sh
cluster/lib/util.sh
+11
-0
ginkgo-e2e.sh
hack/ginkgo-e2e.sh
+2
-1
No files found.
cluster/gke/util.sh
View file @
da112e23
...
...
@@ -255,8 +255,8 @@ function detect-nodes() {
# Detect minions created in the minion group
#
# Note that this will only
return the nodes from one of the cluster's instanc
e
#
groups, regardless of how many the cluster has
.
# Note that this will only
select nodes in the same zone as th
e
#
cluster, meaning that it won't include all nodes in a multi-zone cluster
.
#
# Assumed vars:
# none
...
...
@@ -265,11 +265,14 @@ function detect-nodes() {
function
detect-node-names
{
echo
"... in gke:detect-node-names()"
>
&2
detect-project
detect-node-instance-group
NODE_NAMES
=(
$(
gcloud compute instance-groups managed list-instances
\
"
${
NODE_INSTANCE_GROUP
}
"
--zone
"
${
ZONE
}
"
--project
"
${
PROJECT
}
"
\
--format
=
'value(instance)'
)
)
detect-node-instance-groups
NODE_NAMES
=()
for
group
in
"
${
NODE_INSTANCE_GROUPS
[@]
:-}
"
;
do
NODE_NAMES+
=(
$(
gcloud compute instance-groups managed list-instances
\
"
${
group
}
"
--zone
"
${
ZONE
}
"
\
--project
"
${
PROJECT
}
"
--format
=
'value(instance)'
)
)
done
echo
"NODE_NAMES=
${
NODE_NAMES
[*]
:-}
"
}
...
...
@@ -284,13 +287,17 @@ function detect-node-names {
# ZONE
# CLUSTER_NAME
# Vars set:
# NODE_INSTANCE_GROUP
function
detect-node-instance-group
{
echo
"... in gke:detect-node-instance-group()"
>
&2
local
url
=
$(
"
${
GCLOUD
}
"
${
CMD_GROUP
:-}
container clusters describe
\
# NODE_INSTANCE_GROUP
S
function
detect-node-instance-group
s
{
echo
"... in gke:detect-node-instance-group
s
()"
>
&2
local
url
s
=
$(
"
${
GCLOUD
}
"
${
CMD_GROUP
:-}
container clusters describe
\
--project
=
"
${
PROJECT
}
"
--zone
=
"
${
ZONE
}
"
\
--format
=
'value(instanceGroupUrls)'
"
${
CLUSTER_NAME
}
"
)
NODE_INSTANCE_GROUP
=
"
${
url
##*/
}
"
urls
=(
${
urls
//;/
}
)
NODE_INSTANCE_GROUPS
=()
for
url
in
"
${
urls
[@]
:-}
"
;
do
NODE_INSTANCE_GROUPS+
=(
"
${
url
##*/
}
"
)
done
}
# SSH to a node by name ($1) and run a command ($2).
...
...
cluster/lib/util.sh
View file @
da112e23
...
...
@@ -25,6 +25,17 @@ kube::util::wait-for-jobs() {
return
${
fail
}
}
# kube::util::join <delim> <list...>
# Concatenates the list elements with the delimiter passed as first parameter
#
# Ex: kube::util::join , a b c
# -> a,b,c
function
kube::util::join
{
local
IFS
=
"
$1
"
shift
echo
"
$*
"
}
# Some useful colors.
if
[[
-z
"
${
color_start
-
}
"
]]
;
then
declare
-r
color_start
=
"
\0
33["
...
...
hack/ginkgo-e2e.sh
View file @
da112e23
...
...
@@ -86,7 +86,8 @@ if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then
fi
if
[[
"
${
KUBERNETES_PROVIDER
}
"
==
"gke"
]]
;
then
detect-node-instance-group
detect-node-instance-groups
NODE_INSTANCE_GROUP
=
$(
kube::util::join , NODE_INSTANCE_GROUPS
)
fi
ginkgo_args
=()
...
...
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