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"
31
31
make --directory=" ${REPO_ROOT} " " ${KUBECTL##*/ } " " ${HELM##*/ } " " ${KIND##*/ } " " ${KUSTOMIZE##*/ } "
32
32
KIND_CLUSTER_NAME=" ${KIND_CLUSTER_NAME:- capz} "
33
33
WORKER_MACHINE_COUNT=" ${WORKER_MACHINE_COUNT:- 2} "
34
+ EXTRA_NODES=" ${EXTRA_NODES:- 0} "
34
35
export KIND_CLUSTER_NAME
35
36
# export the variables so they are available in bash -c wait_for_nodes below
36
37
export KUBECTL
@@ -214,6 +215,18 @@ wait_for_pods() {
214
215
done
215
216
}
216
217
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
+
217
230
install_addons () {
218
231
export -f copy_kubeadm_config_map wait_for_copy_kubeadm_config_map
219
232
timeout --foreground 600 bash -c wait_for_copy_kubeadm_config_map
@@ -224,6 +237,8 @@ install_addons() {
224
237
timeout --foreground 1800 bash -c wait_for_nodes
225
238
export -f wait_for_pods
226
239
timeout --foreground 1800 bash -c wait_for_pods
240
+ export -f wait_for_extra_nodes
241
+ timeout --foreground 10800 bash -c wait_for_pods
227
242
}
228
243
229
244
copy_secret () {
You can’t perform that action at this time.
0 commit comments