<p>I am new to helm charts. So please correct me if I am going wrong in understanding. I have a service which I am trying to deploy using helm charts. I want to change the config map name and its key values to read depending on deployment environment. Hence I want to add conditional logic in values.yaml.</p>

<p>Can someone point me to some document/link which explains how to add conditional logic in values.yaml? </p>

<p>A chart's <code>values.yaml</code> is primarily used to set default values, regardless of the environment. It exists to fill chart templates with values. It is not designed to be a template itself, so there is no logic you can apply inside a <code>values.yaml</code> file.</p>

<p>Each environment should have its own <code>values.yaml</code> file. You could store those inside the chart itself, like:</p>

<pre><code>.
├── Chart.yaml
├── README
├── templates
│   ├── config.yaml
│   ├── deployment.app.yaml
│   └── service.app.yaml
├── values.prod.yaml
├── values.test.yaml
└── values.yaml
</code></pre>

<p>Now, when you deploy a chart, you can use the environment specific <code>values.&lt;env&gt;.yaml</code> to override the default values. For your test environment this may look like this:</p>

<pre><code>helm upgrade --install my-chart path/to/my/chart --values path/to/my/chart/values.test.yaml
</code></pre>

<p>Of course you could store the <code>values.&lt;env&gt;.yaml</code> files also outside of your chart directory. You just need to find a way to make them available at chart upgrade/install time to override the chart templates default <code>values.yaml</code>.</p>
