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
5094333b
Commit
5094333b
authored
Jun 22, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix waiting for node upgrades
parent
1de2bdda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
upgrade.sh
cluster/gce/upgrade.sh
+36
-5
No files found.
cluster/gce/upgrade.sh
View file @
5094333b
...
@@ -207,8 +207,6 @@ function prepare-node-upgrade() {
...
@@ -207,8 +207,6 @@ function prepare-node-upgrade() {
source
"
${
KUBE_ROOT
}
/cluster/gce/debian/helper.sh"
source
"
${
KUBE_ROOT
}
/cluster/gce/debian/helper.sh"
fi
fi
create-node-instance-template
"
${
template_name
}
"
create-node-instance-template
"
${
template_name
}
"
# The following is echo'd so that callers can get the template name.
echo
$template_name
echo
"== Finished preparing node upgrade (to
${
KUBE_VERSION
}
). =="
>
&2
echo
"== Finished preparing node upgrade (to
${
KUBE_VERSION
}
). =="
>
&2
}
}
...
@@ -220,8 +218,15 @@ function do-node-upgrade() {
...
@@ -220,8 +218,15 @@ function do-node-upgrade() {
# NOTE(zmerlynn): If you are changing this gcloud command, update
# NOTE(zmerlynn): If you are changing this gcloud command, update
# test/e2e/cluster_upgrade.go to match this EXACTLY.
# test/e2e/cluster_upgrade.go to match this EXACTLY.
local
template_name
=
$(
get-template-name-from-version
${
SANITIZED_VERSION
})
local
template_name
=
$(
get-template-name-from-version
${
SANITIZED_VERSION
})
local
old_templates
=()
local
updates
=()
for
group
in
${
INSTANCE_GROUPS
[@]
}
;
do
for
group
in
${
INSTANCE_GROUPS
[@]
}
;
do
gcloud alpha compute rolling-updates
\
old_templates+
=(
$(
gcloud compute instance-groups managed list
\
--project
=
"
${
PROJECT
}
"
\
--zone
=
"
${
ZONE
}
"
\
--regexp
=
"
${
group
}
"
\
--format
=
'value(instanceTemplate)'
||
true
)
)
update
=
$(
gcloud alpha compute rolling-updates
\
--project
=
"
${
PROJECT
}
"
\
--project
=
"
${
PROJECT
}
"
\
--zone
=
"
${
ZONE
}
"
\
--zone
=
"
${
ZONE
}
"
\
start
\
start
\
...
@@ -230,10 +235,36 @@ function do-node-upgrade() {
...
@@ -230,10 +235,36 @@ function do-node-upgrade() {
--instance-startup-timeout
=
300s
\
--instance-startup-timeout
=
300s
\
--max-num-concurrent-instances
=
1
\
--max-num-concurrent-instances
=
1
\
--max-num-failed-instances
=
0
\
--max-num-failed-instances
=
0
\
--min-instance-update-time
=
0s
--min-instance-update-time
=
0s 2>&1
)
id
=
$(
echo
"
${
update
}
"
|
grep
"Started"
|
cut
-d
'/'
-f
11 |
cut
-d
']'
-f
1
)
updates+
=(
"
${
id
}
"
)
done
# Wait until rolling updates are finished.
for
update
in
${
updates
[@]
}
;
do
while
true
;
do
result
=
$(
gcloud alpha compute rolling-updates
\
--project
=
"
${
PROJECT
}
"
\
--zone
=
"
${
ZONE
}
"
\
describe
\
${
update
}
\
--format
=
'value(status)'
||
true
)
if
[
$result
=
"ROLLED_OUT"
]
;
then
echo
"Rolling update
${
update
}
is
${
result
}
state and finished."
break
fi
echo
"Rolling update
${
update
}
is stil in
${
result
}
state."
sleep
10
done
done
done
# TODO(zmerlynn): Wait for the rolling-update to finish.
# Remove the old templates.
for
tmpl
in
${
old_templates
[@]
}
;
do
gcloud compute instance-templates delete
\
--quiet
\
--project
=
"
${
PROJECT
}
"
\
"
${
tmpl
}
"
||
true
done
echo
"== Finished upgrading nodes to
${
KUBE_VERSION
}
. =="
>
&2
echo
"== Finished upgrading nodes to
${
KUBE_VERSION
}
. =="
>
&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