File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ KUSTOMIZE="${REPO_ROOT}/hack/tools/bin/kustomize"
3131make --directory=" ${REPO_ROOT} " " ${KUBECTL##*/ } " " ${HELM##*/ } " " ${KIND##*/ } " " ${KUSTOMIZE##*/ } "
3232KIND_CLUSTER_NAME=" ${KIND_CLUSTER_NAME:- capz} "
3333WORKER_MACHINE_COUNT=" ${WORKER_MACHINE_COUNT:- 2} "
34+ EXTRA_NODES=" ${EXTRA_NODES:- 0} "
3435export KIND_CLUSTER_NAME
3536# export the variables so they are available in bash -c wait_for_nodes below
3637export KUBECTL
@@ -214,6 +215,18 @@ wait_for_pods() {
214215 done
215216}
216217
218+ # wait_for_extra_nodes accommodates building large clusters gradually
219+ wait_for_extra_nodes () {
220+ local remaining_extra_nodes=" ${EXTRA_NODES} "
221+ while [[ " ${remaining_extra_nodes} " -gt 10 ]]; do
222+ " ${KUBECTL} " --kubeconfig " ${REPO_ROOT} /${KIND_CLUSTER_NAME} .kubeconfig" scale machinedeployment/${CLUSTER_NAME} -md-0 --replicas=10
223+ sleep 120
224+ remaining_extra_nodes=$(( remaining_extra_nodes - 10 ))
225+ done
226+ " ${KUBECTL} " --kubeconfig " ${REPO_ROOT} /${KIND_CLUSTER_NAME} .kubeconfig" scale machinedeployment/${CLUSTER_NAME} -md-0 --replicas=" ${remaining_extra_nodes} "
227+ sleep 120
228+ }
229+
217230install_addons () {
218231 export -f copy_kubeadm_config_map wait_for_copy_kubeadm_config_map
219232 timeout --foreground 600 bash -c wait_for_copy_kubeadm_config_map
@@ -224,6 +237,8 @@ install_addons() {
224237 timeout --foreground 1800 bash -c wait_for_nodes
225238 export -f wait_for_pods
226239 timeout --foreground 1800 bash -c wait_for_pods
240+ export -f wait_for_extra_nodes
241+ timeout --foreground 10800 bash -c wait_for_pods
227242}
228243
229244copy_secret () {
You can’t perform that action at this time.
0 commit comments