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
b30c4d49
Commit
b30c4d49
authored
Apr 12, 2016
by
Alex Robinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GKE kube-up to correctly find an IGM from a multi-zone cluster.
parent
bc8738c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
util.sh
cluster/gke/util.sh
+20
-2
No files found.
cluster/gke/util.sh
View file @
b30c4d49
...
...
@@ -104,6 +104,18 @@ function verify-prereqs() {
${
sudo_prefix
}
gcloud
${
gcloud_prompt
:-}
components update
||
true
}
# Validate a kubernetes cluster
function
validate-cluster
{
# Simply override the NUM_NODES variable if we've spread nodes across multiple
# zones before calling into the generic validate-cluster logic.
local
EXPECTED_NUM_NODES
=
"
${
NUM_NODES
}
"
for
zone
in
$(
echo
"
${
ADDITIONAL_ZONES
}
"
|
sed
"s/,/ /g"
)
do
((
EXPECTED_NUM_NODES +
=
NUM_NODES
))
done
NUM_NODES
=
${
EXPECTED_NUM_NODES
}
bash
-c
"
${
KUBE_ROOT
}
/cluster/validate-cluster.sh"
}
# Instantiate a kubernetes cluster
#
# Assumed vars:
...
...
@@ -224,6 +236,9 @@ function detect-nodes() {
# Detect minions created in the minion group
#
# Note that this will only return the nodes from one of the cluster's instance
# groups, regardless of how many the cluster has.
#
# Assumed vars:
# none
# Vars set:
...
...
@@ -239,7 +254,10 @@ function detect-node-names {
echo
"NODE_NAMES=
${
NODE_NAMES
[*]
}
"
}
# Detect instance group name generated by gke
# Detect instance group name generated by gke.
#
# Note that this will only select instance groups in the same zone as the
# cluster, meaning that it won't include all groups in a multi-zone cluster.
#
# Assumed vars:
# GCLOUD
...
...
@@ -252,7 +270,7 @@ function detect-node-instance-group {
echo
"... in gke:detect-node-instance-group()"
>
&2
NODE_INSTANCE_GROUP
=
$(
"
${
GCLOUD
}
"
${
CMD_GROUP
:-}
container clusters describe
\
--project
=
"
${
PROJECT
}
"
--zone
=
"
${
ZONE
}
"
"
${
CLUSTER_NAME
}
"
\
|
grep
instanceGroupManagers |
cut
-d
'/'
-f
11
)
|
grep
instanceGroupManagers |
grep
"
${
ZONE
}
"
|
cut
-d
'/'
-f
11
)
}
# SSH to a node by name ($1) and run a command ($2).
...
...
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