Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Helm Charts in order of dependencies

I am deploying multiple helm sub-charts in Kubernetes Cluster through Helm and tiller. How can I make sure that a particular chart completely installs its containers before starting to install other charts and their containers?

I looked into requirements.yaml and hooks, none of them look like can be the solution I am looking for.

ParentDir/
    Chart.yaml
    requirements.yaml
    values.yaml
    charts/
    |
    |
    —- App1
        Chart.yaml
        values.yaml
        templates/
    —- App2
        Chart.yaml
        values.yaml
        templates/
    .
    .
    .
    —- AppN
        Chart.yaml
        values.yaml
        templates/

I have multiple sub-charts, and want to make sure containers of App1 are up and ready before helm installs other charts and its containers.

like image 520
Amay Avatar asked May 13 '19 19:05

Amay


2 Answers

You should look into helmfile and split your stack into one helmfile per application. Since helmfiles inside a folders are applied in an alphabetically order you can ensure the order through file naming conventions.

File structure:

helmfile.d/
  00-app-1.yaml
  01-app-2.yaml
  02-app-n.yaml

Execute it with this command: helmfile -f path/to/directory

like image 103
Lukas Eichler Avatar answered Sep 24 '22 15:09

Lukas Eichler


i don't think there is anything from helm chart side but probably you can solve this using the init containers.

if in your charts there is database and used by the application and getting crashed you can use the init container to check to complete lifecycle of pod.

For more you can refer this : https://github.com/helm/helm/issues/1713

like image 43
Harsh Manvar Avatar answered Sep 23 '22 15:09

Harsh Manvar