How to create dependency between releases in helmfile

1.8k Views Asked by At

I have a following helmfile and I want for nexus, teamcity-server, nexus, hub to be depended on certificates chart

releases:
- name: certificates
  createNamespace: true
  chart: ./charts/additional-dep
  namespace: system
  values:
    - ./environments/default/system-values.yaml
    - ./environments/{{ .Environment.Name }}/system-values.yaml

- name: hub
  chart: ./charts/hub
  namespace: system
  values:
    - ./environments/default/system-values.yaml


- name: nexus
  chart: ./charts/nexus
  namespace: system
  values:
    - ./environments/default/system-values.yaml
    - ./environments/{{ .Environment.Name }}/system-values.yaml
  dependsOn:
  - certificates

- name: teamcity-server
  chart: ./charts/teamcity-server
  namespace: system
  values:
    - ./environments/default/system-values.yaml
    - ./environments/{{ .Environment.Name }}/system-values.yaml
  dependsOn:
  - certificates

I have tried to use dependsOn in helmfile.yaml, however it has resulted in errors

1

There are 1 best solutions below

0
On

Helmfile calls this functionality needs:, so

releases:
  - name: certificates
    ...

  - name: nexus
    needs:
      - certificates
    ...

This means the certificates: chart needs to be successfully installed before Helmfile will move on to nexus or teamcity-server. This is specific to Helmfile, so you're allowed to helm uninstall certificates and Helm itself won't know about the dependency. It also doesn't establish any sort of runtime dependency between the two charts, so if something happens later that causes certificates to fail, nexus and the other dependents won't be automatically stopped.