<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>One way of doing it would be to pass one value in with helm install like: </p>

<pre><code>--set environment=&lt;value&gt;
</code></pre>

<p>And then have multiple set of values in your values file for different environments like:</p>

<pre><code>environment: &lt;default&gt;
env1:
  prop1: &lt;value1&gt;
  prop2: &lt;value2&gt;
env2:
  prop1: &lt;value1&gt;
  prop2: &lt;value2&gt;
</code></pre>

<p>Now in your configMap file make use of it like:</p>

<pre><code>{{- if eq .Values.environment "env1" }}
  somekey: {{ .Values.env1.prop1 }}
{{- else }}
  somekey: {{ .Values.env2.prop1 }}
{{- end }}
</code></pre>

<p>That should do the trick for setting dynamic values according to environment or any such condition.</p>

<p>Apart from that there is one more thing I would like to bring to your notice that helm has few more inbuilt object just like <code>.Values</code>, one of which is <code>.Capabilities</code> so may be you can make use of <code>.Capabilities.KubeVersion.Platform</code> to find OS of the system</p>
