title: Use template to define sub-chart values with Helm
body: <p><strong>Use case</strong></p>
  
  <p>"I want to deploy elasticsearch + kibana, by using elastic official helm charts. I want to create a helm chart called data-viz with these charts as dependency."</p>
  
  <p>Running <code>helm install data-viz --set cluster=toto</code> must create an elasticsearch cluster "toto", and a kibana configured with <code>elasticsearchHosts</code> = toto.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>I see here <a href="https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md" rel="noreferrer">https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md</a> it's possible to configure sub-chart from main-chart <code>values.yml</code>. But I would like templatize sub-chart values.yml from main-chart values.yaml, is it possible?</p>
  
  <p>I was thinking to something simple as:</p>
  
  <pre><code>.
  ├── Chart.yaml
  ├── charts
  │   ├── elasticsearch
  │   │   ├── Chart.yaml
  │   │   └── templates
  │   │       └── values.yaml
  │   ├── elasticsearch-7.4.0.tgz
  │   └── kibana-7.4.0.tgz
  ├── requirements.lock
  ├── requirements.yaml
  └── values.yaml
  </code></pre>
  
  <p><strong>Hack solution</strong></p>
  
  <p>A small Python script that creates the <code>values.yaml</code> file from <code>sub-chart/values-template.yaml</code> + data.</p>