Skip to content

Commit 64ce261

Browse files
CecileRobertMichonk8s-infra-cherrypick-robot
authored andcommitted
Wait for nodes after CCM install in ci-entrypoint
1 parent 5480626 commit 64ce261

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/ci-entrypoint.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@ install_addons() {
141141

142142
# Copy the kubeadm configmap to the calico-system namespace. This is a workaround needed for the calico-node-windows daemonset to be able to run in the calico-system namespace.
143143
"${KUBECTL}" create ns calico-system
144+
until "${KUBECTL}" get configmap kubeadm-config --namespace=kube-system
145+
do
146+
# Wait for the kubeadm-config configmap to exist.
147+
sleep 2
148+
done
144149
"${KUBECTL}" get configmap kubeadm-config --namespace=kube-system -o yaml \
145150
| sed 's/namespace: kube-system/namespace: calico-system/' \
146-
| ${KUBECTL} create -f -
151+
| "${KUBECTL}" create -f -
147152

148153
# install Calico CNI
149154
echo "Installing Calico CNI via helm"
@@ -164,9 +169,6 @@ install_addons() {
164169
"${HELM}" repo add projectcalico https://projectcalico.docs.tigera.io/charts
165170
"${HELM}" install calico projectcalico/tigera-operator -f "${CALICO_VALUES_FILE}" --set-string "${CIDR_STRING_VALUES}" --namespace tigera-operator --create-namespace
166171

167-
export -f wait_for_nodes
168-
timeout --foreground 1800 bash -c wait_for_nodes
169-
170172
# Add FeatureOverride for ChecksumOffloadBroken in FelixConfiguration.
171173
# This is the recommended workaround for https://github.com/projectcalico/calico/issues/3145.
172174
"${KUBECTL}" apply -f "${REPO_ROOT}"/templates/addons/calico/felix-override.yaml
@@ -207,6 +209,9 @@ install_addons() {
207209
--set-string cloudControllerManager.clusterCIDR="${CCM_CLUSTER_CIDR}"
208210
fi
209211

212+
export -f wait_for_nodes
213+
timeout --foreground 1800 bash -c wait_for_nodes
214+
210215
echo "Waiting for all calico-system pods to be ready"
211216
"${KUBECTL}" wait --for=condition=Ready pod -n calico-system --all --timeout=10m
212217

@@ -215,7 +220,7 @@ install_addons() {
215220
}
216221

217222
wait_for_nodes() {
218-
echo "Waiting for ${CONTROL_PLANE_MACHINE_COUNT} control plane machine(s), ${WORKER_MACHINE_COUNT} worker machine(s), and ${WINDOWS_WORKER_MACHINE_COUNT} windows machine(s) to become Ready"
223+
echo "Waiting for ${CONTROL_PLANE_MACHINE_COUNT} control plane machine(s), ${WORKER_MACHINE_COUNT} worker machine(s), and ${WINDOWS_WORKER_MACHINE_COUNT:-0} windows machine(s) to become Ready"
219224

220225
# Ensure that all nodes are registered with the API server before checking for readiness
221226
local total_nodes="$((CONTROL_PLANE_MACHINE_COUNT + WORKER_MACHINE_COUNT + WINDOWS_WORKER_MACHINE_COUNT))"

0 commit comments

Comments
 (0)