<p>I am trying to pass a value using the <code>--set</code> in <code>helm3</code>. However, it looks like the yaml file is not pulling/parsing the value.</p>
<p>My folder structure is like below: (there are a few other charts but I have removed them for simplicity)</p>
<pre><code>k8shelmcharts
├── Chart.yaml
└── charts
    ├── postgresdb
    │   ├── Chart.yaml
    │   ├── templates
    │   │   ├── postgres.configmap.yml
    │   │   ├── postgres.deployment.yml
    │   │   ├── postgres.secrets.yml
    │   │   └── postgres.service.yml
    │   └── values.yaml
</code></pre>
<p>and the contents of the <code>postgres.secrest.yml</code> file is:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: postgres-secret
  type: Opaque
data:
  # property-like keys; each key maps to a simple value
  password: {{ .Values.password }}
</code></pre>
<p>( I have also tried <code>.Values.global.password</code> )</p>
<p>When I try to install the charts by running the command (from the root of the helm charts ie: <code>k8shelmcharts</code> folder) <code>helm install testapp . --set password=postgrespasssword --debug --dry-run</code></p>
<p>I get the error:</p>
<pre><code>Error: unable to build kubernetes objects from release manifest: error validating &quot;&quot;: error validating data: unknown object type &quot;nil&quot; in Secret.data.password
helm.go:94: [debug] error validating &quot;&quot;: error validating data: unknown object type &quot;nil&quot; in Secret.data.password
</code></pre>
<p>If I try to generate the templates using <code>helm template testflaskapp . --set password=postgrespassword --debug --dry-run</code>, I can see that the password does not seem to get populated in the <code>postgres.secret.yml</code> file -</p>
<pre><code># Source: flask-k8s-app/charts/postgresdb/templates/postgres.secret.yml
apiVersion: v1
kind: Secret
metadata:
  name: postgres-secret
data:
  # property-like keys; each key maps to a simple value
  password:
</code></pre>
<p>Any help on what I am missing so that I can <code>--set</code> values and pull them in the yaml files successfully? Thanks!</p>

kpython
<p><strong>Option 1:</strong></p>
<pre class="lang-sh prettyprint-override"><code>helm install testapp . --set postgresdb.password=postgrespasssword --debug --dry-run
</code></pre>
<p>The variable should be called <code>postgresdb.password</code>, in the postgres.secrets.yml should stay <code>{{ .Values.password }}</code>.</p>
<p><strong>Option 2</strong></p>
<pre class="lang-sh prettyprint-override"><code>helm install testapp . --set global.password=postgrespasssword --debug --dry-run
</code></pre>
<p>The variable should be called <code>global.password</code>, postgres.secrets.yml should be changed to <code>{{ .Values.global.password }}</code>.</p>
<p>The first option is the preferable one I guess, as probably you are using the postgress password only in the <code>postgresdb</code> subchart.</p>
<p>Reference: <a href="https://helm.sh/docs/chart_template_guide/subcharts_and_globals/" rel="nofollow noreferrer">Subcharts and Global Values</a></p>
