<p>I have a helm values file (yaml) containing the following block: </p>

<pre><code>env:
- name: &lt;key&gt;
  value: &lt;value&gt;
- name: &lt;key1&gt;
  value: &lt;value1&gt;
</code></pre>

<p>I would like to inject the above block into a kubernetes configmap definition. The result should look the following:</p>

<pre><code>data: 
  key: value
  key1: value1
</code></pre>

<p>I tried the following, however the resulting file would contain a yaml sequence instead of a yaml map:</p>

<pre><code>{{ toYaml .Values.env }}
</code></pre>

<p>Any advise helping me to solve the problem is appreciated.</p>

user2074945
<p>You should be able to use:</p>

<pre><code>{{- range .Values.env }}
  {{ .name }}:{{ .value}}
{{- end }}
</code></pre>
