Commit bb41d770 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38695 from jszczepkowski/ha-validation-fix

Automatic merge from submit-queue Fixed validation of multizone cluster for GCE. ```release-note Fixed validation of multizone cluster for GCE ``` Fixed validation of multizone cluster for GCE: taking actual number of worker nodes.
parents 380ad617 0f60aba7
...@@ -51,6 +51,15 @@ ALLOWED_NOTREADY_NODES="${ALLOWED_NOTREADY_NODES:-0}" ...@@ -51,6 +51,15 @@ ALLOWED_NOTREADY_NODES="${ALLOWED_NOTREADY_NODES:-0}"
CLUSTER_READY_ADDITIONAL_TIME_SECONDS="${CLUSTER_READY_ADDITIONAL_TIME_SECONDS:-30}" CLUSTER_READY_ADDITIONAL_TIME_SECONDS="${CLUSTER_READY_ADDITIONAL_TIME_SECONDS:-30}"
EXPECTED_NUM_NODES="${NUM_NODES}" EXPECTED_NUM_NODES="${NUM_NODES}"
if [[ "${KUBERNETES_PROVIDER:-}" == "gce" ]]; then
# In multizone mode we need to add instances for all nodes in the region.
if [[ "${MULTIZONE:-}" == "true" ]]; then
EXPECTED_NUM_NODES=$(gcloud compute instances list --format=[no-heading] --regexp="${NODE_INSTANCE_PREFIX}.*" \
--zones=$(gcloud compute zones list --filter=region=europe-west1 --format=[no-heading]\(name\) | tr "\n" "," | sed "s/,$//") | wc -l)
fi
fi
if [[ "${REGISTER_MASTER_KUBELET:-}" == "true" ]]; then if [[ "${REGISTER_MASTER_KUBELET:-}" == "true" ]]; then
if [[ "${KUBERNETES_PROVIDER:-}" == "gce" ]]; then if [[ "${KUBERNETES_PROVIDER:-}" == "gce" ]]; then
NUM_MASTERS=$(get-master-replicas-count) NUM_MASTERS=$(get-master-replicas-count)
...@@ -59,6 +68,7 @@ if [[ "${REGISTER_MASTER_KUBELET:-}" == "true" ]]; then ...@@ -59,6 +68,7 @@ if [[ "${REGISTER_MASTER_KUBELET:-}" == "true" ]]; then
fi fi
EXPECTED_NUM_NODES=$((EXPECTED_NUM_NODES+NUM_MASTERS)) EXPECTED_NUM_NODES=$((EXPECTED_NUM_NODES+NUM_MASTERS))
fi fi
REQUIRED_NUM_NODES=$((EXPECTED_NUM_NODES - ALLOWED_NOTREADY_NODES)) REQUIRED_NUM_NODES=$((EXPECTED_NUM_NODES - ALLOWED_NOTREADY_NODES))
# Make several attempts to deal with slow cluster birth. # Make several attempts to deal with slow cluster birth.
return_value=0 return_value=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment