<p>I've created a helm chart with sub-charts.</p>
<p>The global helm chart contains <code>values.yaml</code> and <code>values-int.yaml</code> files. as well as all the sub-charts.</p>
<p>this is the structure:</p>
<pre><code>- Global-helm-chart:
  - values.yaml
  - values-int.yaml
  - sub-charts:
    - chart-1:
      - values.yaml
      - value-int.yaml
      - templates:
        - configmap.yaml
    - chart-2:
      - values.yaml
      - value-int.yaml
      - templates:
        - configmap.yaml
</code></pre>
<p>This is the <code>configmap.yaml</code> under <code>chart-1</code> (chart-2 is the same):</p>
<pre><code>{{- $root := .Values -}}
{{ if eq .Values.global.env &quot;int&quot; }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: &quot;{{ .Chart.Name }}-configuration&quot;
data:
  json: {{ $root.tickets | toJson | quote }}
{{ end }}
</code></pre>
<p>this is the <code>values-int.yaml</code> under <code>chart-1</code>:</p>
<pre><code>tickets:
  dynamicEvents:
    topics:
    - topic_name: &quot;ai-recommendations-pending-for-review&quot;
      events:
      - name: &quot;PendingForReview&quot;
        parameters:
          subject: &quot;$.insightTypeId&quot;
          group_uid: &quot;customer_care&quot;
</code></pre>
<p><code>helm template .</code> from the global chart will print out two configMaps, where their values are taken from <code>values.yaml</code> and <code>values-int.yml</code> of the global chart and <strong>not</strong> as expected which is from <code>chart-1</code> and <code>chart-2</code>.</p>
<p>I expect helm template from the global-helm-chart to show the <code>json: </code> in configMap with the values of <code>values-int.yaml</code> under <code>chart-1</code>.</p>
<p>Thanks in advance..</p>

jrz
<p>Helm, on its own, doesn't have a notion of per-environment values files the way you're describing it.  If you run</p>
<pre class="lang-sh prettyprint-override"><code>helm template . -f values-int.yaml
</code></pre>
<p>that reads <code>./values-int.yaml</code> in the current directory, but doesn't look for that file in any other place; in particular it does not try to look for the same-named values file in sub charts.</p>
<p>Instead, you need to fold all of the settings together into a single <code>values-int.yaml</code> file wherever you're running the deployment from (it does not need to be in the chart directory <em>per se</em>).  That single file <a href="https://docs.helm.sh/docs/topics/charts/#scope-dependencies-and-values" rel="nofollow noreferrer">includes settings for all of the sub-charts</a> under top-level keys with the charts' names.</p>
<p>So, with a filesystem layout of:</p>
<pre class="lang-none prettyprint-override"><code>global-helm-chart/
+-- Chart.yaml
+-- values.yaml
+-- values-int.yaml
|
\-- charts/
  +-- chart1/
  | +-- Chart.yaml
  | +-- values.yaml
  | \-- templates/
  |   \-- configmap.yaml
  |
  \-- chart2/ 
    +-- Chart.yaml
    +-- values.yaml
    \-- templates/
      \-- configmap.yaml
</code></pre>
<p>The top-level <code>values-int.yaml</code> would contain:</p>
<pre class="lang-yaml prettyprint-override"><code># Helm values for the integration environment.  These override
# settings in values.yaml in this chart and its subcharts.

global:
  env: int

chart1:
  tickets:
    dynamicEvents: { ... }

chart2: { ... }
</code></pre>
