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
cf41dcae
Commit
cf41dcae
authored
Mar 07, 2017
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle NPD during cluster upgrade.
parent
7b4bec03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
config-default.sh
cluster/gce/config-default.sh
+0
-1
config-test.sh
cluster/gce/config-test.sh
+0
-1
upgrade.sh
cluster/gce/upgrade.sh
+24
-0
No files found.
cluster/gce/config-default.sh
View file @
cf41dcae
...
@@ -148,7 +148,6 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
...
@@ -148,7 +148,6 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
# standalone - Run node problem detector as standalone system daemon.
# standalone - Run node problem detector as standalone system daemon.
if
[[
"
${
NODE_OS_DISTRIBUTION
}
"
==
"gci"
]]
;
then
if
[[
"
${
NODE_OS_DISTRIBUTION
}
"
==
"gci"
]]
;
then
# Enable standalone mode by default for gci.
# Enable standalone mode by default for gci.
# TODO: Consider upgrade test.
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
standalone
}
"
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
standalone
}
"
else
else
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
daemonset
}
"
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
daemonset
}
"
...
...
cluster/gce/config-test.sh
View file @
cf41dcae
...
@@ -173,7 +173,6 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
...
@@ -173,7 +173,6 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
# standalone - Run node problem detector as standalone system daemon.
# standalone - Run node problem detector as standalone system daemon.
if
[[
"
${
NODE_OS_DISTRIBUTION
}
"
==
"gci"
]]
;
then
if
[[
"
${
NODE_OS_DISTRIBUTION
}
"
==
"gci"
]]
;
then
# Enable standalone mode by default for gci.
# Enable standalone mode by default for gci.
# TODO: Consider upgrade test.
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
standalone
}
"
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
standalone
}
"
else
else
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
daemonset
}
"
ENABLE_NODE_PROBLEM_DETECTOR
=
"
${
KUBE_ENABLE_NODE_PROBLEM_DETECTOR
:-
daemonset
}
"
...
...
cluster/gce/upgrade.sh
View file @
cf41dcae
...
@@ -88,6 +88,8 @@ function upgrade-master() {
...
@@ -88,6 +88,8 @@ function upgrade-master() {
detect-master
detect-master
parse-master-env
parse-master-env
upgrade-master-env
backfile-kubeletauth-certs
backfile-kubeletauth-certs
# Delete the master instance. Note that the master-pd is created
# Delete the master instance. Note that the master-pd is created
...
@@ -102,6 +104,15 @@ function upgrade-master() {
...
@@ -102,6 +104,15 @@ function upgrade-master() {
wait-for-master
wait-for-master
}
}
function
upgrade-master-env
()
{
echo
"== Upgrading master environment variables. =="
# Generate the node problem detector token if it isn't present on the original
# master.
if
[[
"
${
ENABLE_NODE_PROBLEM_DETECTOR
:-}
"
==
"standalone"
&&
"
${
NODE_PROBLEM_DETECTOR_TOKEN
:-}
"
==
""
]]
;
then
NODE_PROBLEM_DETECTOR_TOKEN
=
$(
dd
if
=
/dev/urandom
bs
=
128
count
=
1 2>/dev/null |
base64
|
tr
-d
"=+/"
|
dd
bs
=
32
count
=
1 2>/dev/null
)
fi
}
# TODO(mikedanese): delete when we don't support < 1.6
# TODO(mikedanese): delete when we don't support < 1.6
function
backfile-kubeletauth-certs
()
{
function
backfile-kubeletauth-certs
()
{
if
[[
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
&&
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
]]
;
then
if
[[
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
&&
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
]]
;
then
...
@@ -282,6 +293,8 @@ function prepare-node-upgrade() {
...
@@ -282,6 +293,8 @@ function prepare-node-upgrade() {
KUBELET_CERT_BASE64
=
$(
get-env-val
"
${
node_env
}
"
"KUBELET_CERT"
)
KUBELET_CERT_BASE64
=
$(
get-env-val
"
${
node_env
}
"
"KUBELET_CERT"
)
KUBELET_KEY_BASE64
=
$(
get-env-val
"
${
node_env
}
"
"KUBELET_KEY"
)
KUBELET_KEY_BASE64
=
$(
get-env-val
"
${
node_env
}
"
"KUBELET_KEY"
)
upgrade-node-env
# TODO(zmerlynn): How do we ensure kube-env is written in a ${version}-
# TODO(zmerlynn): How do we ensure kube-env is written in a ${version}-
# compatible way?
# compatible way?
write-node-env
write-node-env
...
@@ -295,6 +308,17 @@ function prepare-node-upgrade() {
...
@@ -295,6 +308,17 @@ function prepare-node-upgrade() {
echo
"== Finished preparing node upgrade (to
${
KUBE_VERSION
}
). =="
>
&2
echo
"== Finished preparing node upgrade (to
${
KUBE_VERSION
}
). =="
>
&2
}
}
function
upgrade-node-env
()
{
echo
"== Upgrading node environment variables. =="
# Get the node problem detector token from master if it isn't present on
# the original node.
if
[[
"
${
ENABLE_NODE_PROBLEM_DETECTOR
:-}
"
==
"standalone"
&&
"
${
NODE_PROBLEM_DETECTOR_TOKEN
:-}
"
==
""
]]
;
then
detect-master
local
master_env
=
$(
get-master-env
)
NODE_PROBLEM_DETECTOR_TOKEN
=
$(
get-env-val
"
${
master_env
}
"
"NODE_PROBLEM_DETECTOR_TOKEN"
)
fi
}
# Prereqs:
# Prereqs:
# - prepare-node-upgrade should have been called successfully
# - prepare-node-upgrade should have been called successfully
function do
-node-upgrade
()
{
function do
-node-upgrade
()
{
...
...
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