Using global parameter in helm without running master chart

11/9/2018

I have this structure of helm charts:

-chart A- \
                   -chart A1
                   -chart A2
-chart B- \
                   -chart B1
                   -chart B2
-chart C-\
                   -chart C1
                   -chart C3

What I need is a global parameter or environment variable that I can apply to all charts without having a master chart above all charts.

So when I will run helm install I wouldnt have to pass this parameter using --set to all "main" charts (A,B,C).

Is this possible?

-- Shachar Hamuzim Rajuan
kubernetes-helm

2 Answers

11/11/2018

You might want to consider using a xxx.yaml file to override your charts default properties and template this file with that environment variable. I think that approach is much more maintainable than using --set cli option.

Another approach is using something like Landscaper, listed on the Helm documentation, to template your charts ins an easy way

-- Carlos
Source: StackOverflow

11/11/2018

You can give multiple --set and -f options to helm install, and so the best solution available is to write your "global" settings into a file and always pass a -f global-settings.yaml option to helm install (along with whatever other chart-specific settings and values files you have).

If everything you're installing is in a single namespace, depending on what the settings actually do, it may work to put them into a shared ConfigMap. This is a little trickier to manage (you probably need to manually run kubectl commands), and there are many things you can do with Helm values that you couldn't with a shared ConfigMap. But, it's "automatic" in the way you suggest in the question; you don't need any Helm options at all to use it.

-- David Maze
Source: StackOverflow