<p>I am trying to access the key - values from a custom value file <code>secretvalues.yaml</code> passed to helm with the <code>-f</code> parameter. The key - value in this file is being passed to the yaml file <code>postgres.configmap.yml</code>.</p>
<p>here is my folder structure (there are there are a few other charts but I have removed them for simplicity)</p>
<pre><code>├── k8shelmcharts
│   ├── Chart.yaml
│   ├── charts
│   │   ├── postgres-service
│   │   │   ├── Chart.yaml
│   │   │   ├── templates
│   │   │   │   ├── postgres.configmap.yml
│   │   │   │   ├── postgres.deployment.yml
│   │   │   │   └── postgres.service.yml
│   │   │   └── values.yaml
│   └── secretvalues.yaml
</code></pre>
<p>The contents of the <code>values.yaml</code> file in the <code>postgres-services/</code> folder is</p>
<pre><code>config:
  postgres_admin_name: &quot;postgres&quot;
</code></pre>
<p>The contents of the <code>secretvalues.yaml</code> file in the <code>k8shelmchars/</code> folder is</p>
<pre><code>secrets:
  postgres_admin_password: &quot;password&quot;
</code></pre>
<p>and the contents of the <code>postgres.configmap.yml</code> file in the <code>postgres-services/</code> folder is</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: postgres-config
data:
  # property-like keys; each key maps to a simple value
  POSTGRES_USER: {{ .Values.config.postgres_admin_name }}
  POSTGRES_PASSWORD: {{ .secretvalues.secrets.postgres_admin_password }}
</code></pre>
<p>I have tried several combinations here like <code>.secretvalues.secrets.postgres_admin_password</code>, <code>.Secretvalues.secrets.postgres_admin_password</code> and tried to remove the <code>secrets</code> key but no avail.</p>
<p>When I run the command to install the charts <code>helm install -f k8shelmcharts/secretvalues.yaml testapp k8shelmcharts/ --dry-run --debug</code>
I get the error:</p>
<pre><code>Error: template: flask-k8s-app/charts/postgresdb/templates/postgres.configmap.yml:8:37: executing &quot;flask-k8s-app/charts/postgresdb/templates/postgres.configmap.yml&quot; at &lt;.secretvalues.parameters.postgres_admin_password&gt;: nil pointer evaluating interface {}.parameters
helm.go:94: [debug] template: flask-k8s-app/charts/postgresdb/templates/postgres.configmap.yml:8:37: executing &quot;flask-k8s-app/charts/postgresdb/templates/postgres.configmap.yml&quot; at &lt;.secretvalues.parameters.postgres_admin_password&gt;: nil pointer evaluating interface {}.parameters
</code></pre>
<p>my question is how do I access the <code>secret.postgres_admin_password</code> ?</p>
<p>I am using <code>helm3</code></p>
<p>Thanks!</p>
<hr />
<p>Trying to access the key-values from the <code>secretvalues.yaml</code> file by using <code>POSTGRES_PASSWORD: {{ .Values.config.postgres_admin_password }}</code> in the <code>postgres.configmap.yml</code> seems to pull null/nil values.</p>
<p>I am getting the error when I run <code>helm install testapp k8shelmcharts/ --dry-run --debug -f k8shelmcharts/secretvalues.yaml</code>:</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 ConfigMap.data.POSTGRES_PASSWORD
helm.go:94: [debug] error validating &quot;&quot;: error validating data: unknown object type &quot;nil&quot; in ConfigMap.data.POSTGRES_PASSWORD
</code></pre>
<p>When I try to debug the template using <code>helm template k8shelmcharts/ --debug</code>, I see:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: postgres-config
data:
  # property-like keys; each key maps to a simple value
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD:         
</code></pre>
<p>indicating helm is not able to pull values from the <code>secretvalues.yaml</code> file. NOTE: I have updated the key from <code>secrets</code> to <code>config</code> in the  <code>secretvalues.yaml</code> file.</p>

kpython
<p>Values from all files are merged into one object <code>Values</code>, so you should access variables from the <code>secretvalues.yaml</code> the same way you access the others, i.e.</p>
<pre><code>.Values.secrets.postgres_admin_password
</code></pre>
