Skip to content

Commit 93a0124

Browse files
committed
Kubernetes: create local cluster for to init
Wait for calico api resources to initialize before announcing local cluster is ready. Waiting for calico pods to start was not enough.
1 parent 6ebeb99 commit 93a0124

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/create_local_k8s_cluster.bash

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,9 @@ kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.30.2
4949

5050
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.30.2/manifests/custom-resources.yaml
5151

52-
while ! kubectl get pods -A -l k8s-app=calico-node 2>/dev/null | grep -q "Running"; do echo "Waiting for Calico pods to start..."; sleep 1; done
52+
while ! kubectl get pods -A -l k8s-app=calico-node 2>/dev/null | grep --quiet "Running"; do echo "Waiting for Calico pods to start..."; sleep 1; done
53+
54+
while ! kubectl api-resources --api-group=projectcalico.org | grep --ignore-case networkpolicy >/dev/null 2>&1; do
55+
echo "Waiting for Calico API resources to be available (e.g. NetworkPolicy)..."
56+
sleep 1
57+
done

0 commit comments

Comments
 (0)