Garden deploy fails first time on k8s ingress
# 🌱|help-and-getting-started
i
Given I have a fresh k8s and no .garden folder, when I do a
garden deploy
where I have a kubernetes or a container module, that defines ingresses, then the module fails because it tries to create the ingress too early:
Copy code
Failed deploying service 'prometheus' (from module 'prometheus'). Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Command "/Users/xy/.garden/tools/kubectl/f8a39834529cd1ed/kubectl --context=minikube apply --output=json -f -" failed with code 1:

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": failed to call webhook: Post
"https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": dial tcp 10.101.27.41:443: connect: connection refused

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": failed to call webhook: Post
"https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": dial tcp 10.101.27.41:443: connect: connection refused
It succeeds when I rerun
garden deploy
b
Hey @icy-furniture-17516! Is this Garden Bonsai (0.13)?
i
No, 0.12 still
Not sure what can be done here, I dont remember I've seen a proper way to detect a pod behind a webhook is started or not
Just wanted to bring up, maybe someone else has an idea
However since this was happpening with the default garden ingress, garden could specifically check for the webhook pod readiness using labels or something
Maybe already fixed in 0.13, I can give it a try later next week
q
I've invited you to our Empathy Session doc ahead of our Tuesday meet. The steps under "Session Framework" should get you started with Bonsai. I think testing this race condition would be a good start but the framework is written to be open-ended so please start with whatever you prioritize first πŸ™‚
10 Views