<p>I would like to create serveral ConfiMaps with one helm telmplate. Therefore I have created a folder for the configs/values and one configfile per ConfigMap. I have read the helm template guide and found nothing helpful for my problem. Maybe I missunderstood the possibilities of helm. </p>

<p>Afterwards there is a possibility to create one configmap from serveral files:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-configmap
data:
  {{- $files := .Files }}
  {{- range tuple "file1.yaml" "file2.yaml" }}
  {{ $files.Get . }}
  {{- end }}
</code></pre>

<p>Any recommendations would be helpful,
Thanks,</p>

<p>Best wishes</p>

soa
<p>thank you for the response. I have something different in mind. My new code makes it a little bit more clearly. </p>

<pre><code>{{ range $k, $v :=  .Values.configs }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap
  namespace: {{ $.Values.namespace }}
  labels:
    app: "{{base $v}}"
data:
  key: {{$k}}
  value: {{$v}}
{{ $.Files.Get  $v }}
{{ end }}
</code></pre>

<p>I have a Loop over the ConfigMap. My values.yaml looks like</p>

<pre><code>configs
   name: configs/file1
   name: configs/file2
</code></pre>

<p>The values are in a separate folder configs, one file per configmap. </p>

<p>The current problem is, that the result is one ConfigMap with the values of file2. I would expect two ConfigMaps. What is wrong here in my template. </p>

<p>Thank you very much.</p>
