<p>I am new to helm and I want to know how I can pass variables from the parent package to children.
I have a multi microservices application which consists of different helm packages as below:</p>

<pre><code>$ tree parent/
parent/
├── charts/
│   ├── child-A-0.0.1.tgz
│   ├── child-B-0.0.1.tgz
│   └── child-C-0.0.1.tgz
├── Chart.yaml
├── templates/
│   ├── NOTES.txt
│   └── secret.yaml
└── values.yaml
</code></pre>

<p>And for example, I want to set <code>public-IP</code> in the parent <code>values.yaml</code> and when I install the parent that <code>public-IP</code> passed and set in the children as well.</p>

AVarf
<p><a href="https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#overriding-values-from-a-parent-chart" rel="nofollow noreferrer">Overriding values of a child chart</a> is described in the Helm documentation.</p>
<p>In the parent chart's <code>values.yaml</code> file (or an external file you pass to <code>helm install -f</code>) you can explicitly override values for a subchart:</p>
<pre class="lang-yaml prettyprint-override"><code>childA:
  publicIP: 10.10.10.10
</code></pre>
<p>The top-level values key <code>global</code> is also always passed to child charts, but the chart needs to know to look for it.</p>
<pre class="lang-yaml prettyprint-override"><code>global:
  publicIP: 10.10.10.10
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>env:
  - name: PUBLIC_IP
    value: {{ .Values.global.publicIP }}
</code></pre>
<p>This resolution happens fairly early in the Helm setup phase, so there's no way to pass a computed value to a subchart, or to pass the same value from the parent chart's top-level config into subcharts without restructuring things into <code>global</code>.</p>
