mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Util script - move variables setting for replicated master to outer if
This commit is contained in:
parent
21d4d13d98
commit
f48268d13b
@ -3578,11 +3578,11 @@ function kube-down() {
|
|||||||
|
|
||||||
# In the replicated scenario, if there's only a single master left, we should also delete load balancer in front of it.
|
# In the replicated scenario, if there's only a single master left, we should also delete load balancer in front of it.
|
||||||
if [[ "${REMAINING_MASTER_COUNT}" -eq 1 ]]; then
|
if [[ "${REMAINING_MASTER_COUNT}" -eq 1 ]]; then
|
||||||
|
detect-master
|
||||||
|
local REMAINING_REPLICA_NAME="$(get-all-replica-names)"
|
||||||
|
local REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \
|
||||||
|
--project "${PROJECT}" --format="value(zone)")
|
||||||
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
||||||
detect-master
|
|
||||||
local REMAINING_REPLICA_NAME="$(get-all-replica-names)"
|
|
||||||
local REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \
|
|
||||||
--project "${PROJECT}" --format="value(zone)")
|
|
||||||
gcloud compute forwarding-rules delete \
|
gcloud compute forwarding-rules delete \
|
||||||
--project "${PROJECT}" \
|
--project "${PROJECT}" \
|
||||||
--region "${REGION}" \
|
--region "${REGION}" \
|
||||||
|
Loading…
Reference in New Issue
Block a user