Skip to content

Commit cca01b1

Browse files
committed
Explicitly probe for frr-k8s webhook readiness
Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
1 parent 6061601 commit cca01b1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

contrib/kind-common

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,28 @@ install_ffr_k8s() {
785785
sed -i "${LINE_NUM}a\\${IPv6_LINE}" receive_filtered.yaml
786786
done
787787
fi
788+
789+
# frr-k8s webhook is declaring readiness before its endpoint is serving.
790+
# Let's do our own probing. Also will print logs in case of failure so we get
791+
# insights on why this is hapenning
792+
local r
793+
r=0
794+
timeout 60s bash -x <<EOF || r=$?
795+
echo "Attempting to reach frr-k8s webhook"
796+
kind export kubeconfig --name ovn
797+
while true; do
798+
docker exec ovn-control-plane curl -ksS --connect-timeout 0.1 https://$(kubectl get svc -n frr-k8s-system frr-k8s-webhook-service -o jsonpath='{.spec.clusterIP}')
799+
[ \$? -eq 0 ] && exit 0
800+
echo "Couldn't reach frr-k8s webhook, trying in 1s..."
801+
sleep 1s
802+
done
803+
EOF
804+
echo "r=$r"
805+
if [ "$r" -ne "0" ]; then
806+
kubectl describe pod -n frr-k8s-system -l app=frr-k8s-webhook-server
807+
kubectl logs -n frr-k8s-system -l app=frr-k8s-webhook-server
808+
fi
809+
788810
kubectl apply -n frr-k8s-system -f receive_filtered.yaml
789811
popd || exit 1
790812

0 commit comments

Comments
 (0)