mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Add the salt-overlay and /etc/salt directories to the GCE master-pd and reserve
the master's IP upon creation to make it easier to replace the master later. This pulls out the parts of PR #3174 that don't break anything and will make upgrading existing clusters in the future less painful. Add /etc/salt to the master-pd
This commit is contained in:
@@ -454,7 +454,7 @@ function kube-up {
|
||||
echo "readonly DNS_SERVER_IP='${DNS_SERVER_IP:-}'"
|
||||
echo "readonly DNS_DOMAIN='${DNS_DOMAIN:-}'"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/common.sh"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/format-and-mount-pd.sh"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/mount-pd.sh"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/create-dynamic-salt-files.sh"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/download-release.sh"
|
||||
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/salt-master.sh"
|
||||
@@ -548,6 +548,16 @@ function kube-up {
|
||||
|
||||
detect-master
|
||||
|
||||
# Reserve the master's IP so that it can later be transferred to another VM
|
||||
# without disrupting the kubelets. IPs are associated with regions, not zones,
|
||||
# so extract the region name, which is the same as the zone but with the final
|
||||
# dash and characters trailing the dash removed.
|
||||
local REGION=${ZONE%-*}
|
||||
gcloud compute addresses create "${MASTER_NAME}-ip" \
|
||||
--project "${PROJECT}" \
|
||||
--addresses "${KUBE_MASTER_IP}" \
|
||||
--region "${REGION}"
|
||||
|
||||
echo "Waiting for cluster initialization."
|
||||
echo
|
||||
echo " This will continually check to see if the API for kubernetes is reachable."
|
||||
@@ -727,6 +737,14 @@ function kube-down {
|
||||
routes=( "${routes[@]:10}" )
|
||||
done
|
||||
|
||||
# Delete the master's reserved IP
|
||||
local REGION=${ZONE%-*}
|
||||
gcloud compute addresses delete \
|
||||
--project "${PROJECT}" \
|
||||
--region "${REGION}" \
|
||||
--quiet \
|
||||
"${MASTER_NAME}-ip" || true
|
||||
|
||||
}
|
||||
|
||||
# Update a kubernetes cluster with latest source
|
||||
|
Reference in New Issue
Block a user