Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

helm dependencies with different namespaces

Right now, I have to install multiple helm charts in different namespaces for my product to work. I am trying to create a super helm chart in which I am planning to add the helm charts (of my tools, as mentioned above) and install them in one shot. My problem is, as these tools are in different namespaces I am not sure where to specify the namespace key where I want that particular dependency (chart) to be installed. For e.g. if below is the Charts.yaml of my super helm chart

dependencies:
- name: first_chart
  version: 1.2.3
  repository: https://firstchart.repo
- name: second_chart
  version: 1.5.6
  repository: https://secondchart.repo

I want my first chart to be installed in namespace foo and the second chart to be installed in namespace bar.

I was looking at using conditions but I believe conditions will only take a boolean as a value.

I stumbled upon this link (https://github.com/helm/helm/issues/2060) which says the we can do it in Helm 3 but mostly on how to keep releases between different namespaces. It does not specifically answer my question.

like image 864
Seeker Avatar asked May 05 '26 04:05

Seeker


1 Answers

There is no builtin way to do this with pure Helm, but there is with helmfile.

Your example as helmfile.yaml:

releases:
  - name: chart1 # name of the release (helm install <...> first_chart)
    chart: repo1/first_chart
    version: 1.2.3
    namespace: foo

  - name: chart2
    chart: repo2/second_chart
    version: 1.5.6
    namespace: bar

# in case you want helmfile to automatically update repos
repositories:
  - name: repo1
    url: https://firstchart.repo
  - name: repo2
    url: https://secondchart.repo

Then, run:

  • helmfile sync => run helm install/upgrade on all releases, or
  • helmfile apply => same as sync, but do a diff first to only upgrade/install releases that changed

There is way more to helmfile, but this is the gist.

PS: if you struggle with values or want to have something similar to how umbrella Chart values are handled, have a look at helmfile: a simple trick to handle values intuitively

like image 121
Derlin Avatar answered May 10 '26 04:05

Derlin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!