alias for parent chart

11/15/2019

I have one parent chart and multiple aliased child charts. I able to alias child chart and pass different values:

    Parent Chart 
    chart1
      charts
       Chart.yaml
       templates
          pvc.yaml
          service.yaml
          statefulset.yaml
          NOTES.txt
          _helper.tpl
  Charts.yaml   
  requirments.yaml
  templates
     helper.tpl
      pvc.yaml
      statefulset.yaml

I am able to specify multiple alias in requirement.yaml for child chart as I have to pass different variables and env variable on each chart creation. This works fine.

requirement.yaml looks like following:

dependencies:
- name: chart1
  version: ">= 0.0.1"
  repository: file://./charts/chart1/
  alias: test1

- name: chart1
  version: ">= 0.0.1"
  repository: file://./charts/chart1/
  alias: test2

Is there a way, I can create alias for parent chart and execute parent chart multiple times with different values after the creation of child charts. I have to get into this situation because I cannot pass different env variable and other variables to replica of statefulset and it requires lot of work.

Please suggest.

-- drifter
kubernetes
kubernetes-helm

1 Answer

11/20/2019

Helm aliases only works with dependencies.

Since the dependencies are within the chart folder structure, it would not make much sense to call the chart itself.

So basically you may create an alias for the parent chart but only if the parent chart becomes a dependency.

I hope it helps.

-- OhHiMark
Source: StackOverflow