Skip to content

Commit ed3075b

Browse files
committed
Fix CI: wait for ingress-nginx admission webhook before deploying
The controller pod being Ready doesn't guarantee the admission webhook service is accepting connections. Add a polling loop that waits for the webhook endpoint to have an IP assigned before applying the Ingress resource, preventing "connection refused" errors during kustomize apply. https://claude.ai/code/session_01RNJ3dVjV1VTHcC9ugE3FQJ
1 parent e8d4671 commit ed3075b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/k8s-manifests-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ jobs:
7979
run: |
8080
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
8181
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s
82+
# Wait for the admission webhook to be ready to accept connections
83+
echo "Waiting for ingress-nginx admission webhook..."
84+
for i in $(seq 1 30); do
85+
if kubectl get endpoints -n ingress-nginx ingress-nginx-controller-admission -o jsonpath='{.subsets[0].addresses[0].ip}' 2>/dev/null | grep -q .; then
86+
echo "Webhook endpoint ready"
87+
break
88+
fi
89+
echo " attempt $i/30 - waiting..."
90+
sleep 2
91+
done
8292
8393
- name: Deploy with Kustomize
8494
if: steps.check.outputs.exists == 'true'

0 commit comments

Comments
 (0)