Add support for HA kubemark

This commit is contained in:
Maciej Borsz 2019-07-11 11:56:36 +02:00
parent 9138514fab
commit bf5424bbbf

View File

@ -35,6 +35,10 @@ function create-kubemark-master {
# We intentionally override env vars in subshell to preserve original values.
# shellcheck disable=SC2030,SC2031
(
# All calls to e2e-grow-cluster must share temp dir with initial e2e-up.sh.
kube::util::ensure-temp-dir
export KUBE_TEMP="${KUBE_TEMP}"
export KUBECONFIG="${RESOURCE_DIRECTORY}/kubeconfig.kubemark"
export CLUSTER_NAME="${CLUSTER_NAME}-kubemark"
export KUBE_CREATE_NODES=false
@ -72,6 +76,13 @@ function create-kubemark-master {
done
"${KUBE_ROOT}/hack/e2e-internal/e2e-up.sh"
if [[ "${KUBEMARK_HA_MASTER:-}" == "true" && -n "${KUBEMARK_MASTER_ADDITIONAL_ZONES:-}" ]]; then
for KUBE_GCE_ZONE in ${KUBEMARK_MASTER_ADDITIONAL_ZONES}; do
KUBE_GCE_ZONE="${KUBE_GCE_ZONE}" KUBE_REPLICATE_EXISTING_MASTER=true \
"${KUBE_ROOT}/hack/e2e-internal/e2e-grow-cluster.sh"
done
fi
)
}
@ -85,6 +96,14 @@ function delete-kubemark-master {
export KUBE_DELETE_NETWORK=false
# Even if the "real cluster" is private, we shouldn't manage cloud nat.
export KUBE_GCE_PRIVATE_CLUSTER=false
if [[ "${KUBEMARK_HA_MASTER:-}" == "true" && -n "${KUBEMARK_MASTER_ADDITIONAL_ZONES:-}" ]]; then
for KUBE_GCE_ZONE in ${KUBEMARK_MASTER_ADDITIONAL_ZONES}; do
KUBE_GCE_ZONE="${KUBE_GCE_ZONE}" KUBE_REPLICATE_EXISTING_MASTER=true \
"${KUBE_ROOT}/hack/e2e-internal/e2e-shrink-cluster.sh"
done
fi
"${KUBE_ROOT}/hack/e2e-internal/e2e-down.sh"
)
}