Automate deployments on Kubernetes Automate deployments on Kubernetes kubernetes kubernetes

Automate deployments on Kubernetes


Unfortunately you cannot control the order of installation of dependent Helm charts. Helm groups together the chart's templates and all of its dependencies' templates and applies them as if they came from the same chart (see here for more details on the ordering).

You could write a Python script that installs the charts one after the other using PyHelm (full disclosure - I'm one of the maintainers of the package).

In addition, you can use Helm hooks in order to control the order of the installation - that can take care of your additional yamls (e.g. using the post-install/post-upgrade hooks).


A possible solution is to use initContainer that will wait for other services to be UP.

Typically, for a given A and B application, you will use helm or event better helmfile to deploy them both at the same time. But for the pod of B, you will add an initContainer, that will check say every 10 seconds if service A is started. By doing this, you are sure that service B will only start when service A is fully started and ready. You can have a look at https://kubernetes.io/docs/concepts/workloads/pods/init-containers/. This requires to configure livenessProbe and readynessProbe.

Note that this will not really order chart installation, simply ensure that each service will wait for dependendancies before start. And you can install many chart at the same time using helmfile (https://github.com/roboll/helmfile).