mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-31 16:46:54 +00:00
Merge pull request #77271 from krzysied/gce_instance_parallel
Creating instance groups in parallel
This commit is contained in:
@@ -2795,18 +2795,21 @@ function create-linux-nodes() {
|
||||
this_mig_size=$((${instances_left} / (${NUM_MIGS}-${i}+1)))
|
||||
instances_left=$((instances_left-${this_mig_size}))
|
||||
|
||||
gcloud compute instance-groups managed \
|
||||
create "${group_name}" \
|
||||
--project "${PROJECT}" \
|
||||
--zone "${ZONE}" \
|
||||
--base-instance-name "${group_name}" \
|
||||
--size "${this_mig_size}" \
|
||||
--template "${template_name}" || true;
|
||||
gcloud compute instance-groups managed wait-until-stable \
|
||||
"${group_name}" \
|
||||
--zone "${ZONE}" \
|
||||
--project "${PROJECT}" \
|
||||
--timeout "${MIG_WAIT_UNTIL_STABLE_TIMEOUT}" || true &
|
||||
# Run instance-groups creation in parallel.
|
||||
{
|
||||
gcloud compute instance-groups managed \
|
||||
create "${group_name}" \
|
||||
--project "${PROJECT}" \
|
||||
--zone "${ZONE}" \
|
||||
--base-instance-name "${group_name}" \
|
||||
--size "${this_mig_size}" \
|
||||
--template "${template_name}" || true;
|
||||
gcloud compute instance-groups managed wait-until-stable \
|
||||
"${group_name}" \
|
||||
--zone "${ZONE}" \
|
||||
--project "${PROJECT}" \
|
||||
--timeout "${MIG_WAIT_UNTIL_STABLE_TIMEOUT}" || true
|
||||
} &
|
||||
done
|
||||
wait
|
||||
}
|
||||
|
Reference in New Issue
Block a user