Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm wait till dependency deployment are ready on kubernetes

I'm using helm chart to deploy my application on kubernetes. But services that I'm using in my stack depends on other services how do I make sure helm will not deploy until the dependencies are up?

like image 884
Cycl0n3 Avatar asked Feb 28 '19 15:02

Cycl0n3


People also ask

Why my deployment is not ready in Kubernetes?

If a Pod is Running but not Ready it means that the Readiness probe is failing. When the Readiness probe is failing, the Pod isn't attached to the Service, and no traffic is forwarded to that instance.

What does Helm -- Wait do?

When using --wait , Helm will wait until a minimum expected number of Pods in the deployment are launched before marking the release as successful. Helm will wait as long as what is set with --timeout . By default, the timeout is set to 300 seconds.

What is Helm dependency update?

It will pull down the latest charts that satisfy the dependencies, and clean up old dependencies. On successful update, this will generate a lock file that can be used to rebuild the dependencies to an exact version.

How do I know if Tiller is installed?

After helm init , you should be able to run kubectl get pods --namespace kube-system and see Tiller running. Once Tiller is installed, running helm version should show you both the client and server version.


1 Answers

Typically you don't; you just let Helm (or kubectl apply -f) start everything in one shot and let it retry starting everything.

The most common pattern is for a container process to simply crash at startup if an external service isn't available; the Kubernetes Pod mechanism will restart the container when this happens. If the dependency never comes up you'll be stuck in CrashLoopBackOff state forever, but if it appears in 5-10 seconds then everything will come up normally within a minute or two.

Also remember that pods of any sort are fairly disposable in Kubernetes. IME if something isn't working in a service one of the first things to try is kubectl delete pod and letting a Deployment controller recreate it. Kubernetes can do this on its own too, for example if it decides it needs to relocate a pod on to a different node. That is: even if some dependency is up when your pod first start sup, there's no guarantee it will stay up forever.

like image 173
David Maze Avatar answered Oct 27 '22 21:10

David Maze