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
19a68ef5
Commit
19a68ef5
authored
Mar 07, 2017
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate kubelet auth cert on upgrades
parent
d64434c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
upgrade.sh
cluster/gce/upgrade.sh
+46
-0
No files found.
cluster/gce/upgrade.sh
View file @
19a68ef5
...
@@ -88,6 +88,7 @@ function upgrade-master() {
...
@@ -88,6 +88,7 @@ function upgrade-master() {
detect-master
detect-master
parse-master-env
parse-master-env
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
# with auto-delete=no, so it should not be deleted.
# with auto-delete=no, so it should not be deleted.
...
@@ -101,6 +102,51 @@ function upgrade-master() {
...
@@ -101,6 +102,51 @@ function upgrade-master() {
wait-for-master
wait-for-master
}
}
# TODO(mikedanese): delete when we don't support < 1.6
function
backfile-kubeletauth-certs
()
{
if
[[
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
&&
!
-z
"
${
KUBEAPISERVER_CERT_BASE64
:-}
"
]]
;
then
return
0
fi
mkdir
-p
"
${
KUBE_TEMP
}
/pki"
echo
"
${
CA_KEY_BASE64
}
"
|
base64
-d
>
"
${
KUBE_TEMP
}
/pki/ca.key"
echo
"
${
CA_CERT_BASE64
}
"
|
base64
-d
>
"
${
KUBE_TEMP
}
/pki/ca.crt"
(
cd
"
${
KUBE_TEMP
}
/pki"
download-cfssl
cat
<<
EOF
> ca-config.json
{
"signing": {
"client": {
"expiry": "43800h",
"usages": [
"signing",
"key encipherment",
"client auth"
]
}
}
}
EOF
# the name kube-apiserver is bound to the node proxy
# subpaths required for the apiserver to hit proxy
# endpoints on the kubelet's handler.
cat
<<
EOF
\
| "
${
KUBE_TEMP
}
/cfssl/cfssl" gencert \
-ca=ca.crt \
-ca-key=ca.key \
-config=ca-config.json \
-profile=client \
- \
| "
${
KUBE_TEMP
}
/cfssl/cfssljson" -bare kube-apiserver
{
"CN": "kube-apiserver"
}
EOF
)
KUBEAPISERVER_CERT_BASE64
=
$(
cat
"
${
KUBE_TEMP
}
/pki/kube-apiserver.pem"
|
base64
|
tr
-d
'\r\n'
)
KUBEAPISERVER_KEY_BASE64
=
$(
cat
"
${
KUBE_TEMP
}
/pki/kube-apiserver-key.pem"
|
base64
|
tr
-d
'\r\n'
)
}
function
wait-for-master
()
{
function
wait-for-master
()
{
echo
"== Waiting for new master to respond to API requests =="
echo
"== Waiting for new master to respond to API requests =="
...
...
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