<p>I have been implementing helm sub-chart by referring <a href="https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md" rel="nofollow noreferrer">helm sub chart documentation</a>. According to the documentation it worked for me. This works fine with default value files. But when I try to refer my own value file, the values are not there in the configmap.
My value file is values.staging.yaml.</p>
<p>eg :-</p>
<p>config.yaml in mysubchart</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
    name: {{ .Release.Name }}-configmap
data:
    salad: {{ .Values.dessert }}
</code></pre>
<p>values.staging.yaml in mysubchart</p>
<pre><code>dessert: banana
</code></pre>
<p>values.yaml in mysubchart</p>
<pre><code>dessert: cake
</code></pre>
<p>Only 'cake' is referenced as the value. I need to reference banana as the value.</p>
<p>I have tried following commands.</p>
<ol>
<li>helm install --dry-run --debug mychart --values mychart/charts/mysubchart/values.staging.yaml</li>
<li>helm install --dry-run --debug --name mychart mychart -f mychart/charts/mysubchart/values.staging.yaml</li>
<li>helm install --name mychart mychart -f mychart/charts/mysubchart/values.staging.yaml</li>
</ol>
<p>In each instance the configmap does not refer the value in the values.staging.yaml.</p>
<p>Is there a way to do this?</p>
<p>Thank you .!</p>

<p>As described in <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> in your link, you need to wrap the subchart values in a key matching the name of the subchart.</p>
<p>Any values file you pass with <code>helm install -f</code> is always interpreted at the top level, even if it's physically located in a subchart's directory.  A typical values file could look like</p>
<pre><code>mysubchart:
  dessert: banana
</code></pre>
