Skip to content

Commit b1530ad

Browse files
authored
Kubernetes local cluster wait to init (#1247)
* Kubernetes: fix `cert-manager` first installation All resources that rely on `cert-manager` CRDs should be installed after 1) CRDs are installed (achieved via `helm.sh/hook: post-install,post-upgrade`) 2) webhook server is ready to accept connections (achieved via `helm.sh/hook-weight: "10"` which makes it wait until startupapicheck job is completed aka `cert-manager` is ready) Related issue/s * closes #1241 * Remove quotes around hook annotation * 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 3e9806d commit b1530ad

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)