<p>i have a list of customer ids that i want to pass to the values.yml in the helm chart , and then for each customer create a deployment is that possible? this is what i want to pass in values.yml:</p>
<pre class="lang-yaml prettyprint-override"><code>customer:
  - 62
  - 63
</code></pre>
<p>and this is my deployment template
<a href="https://gist.github.com/JacobAmar/8c45e98f9c34bfd662b9fd11a534b9d5" rel="nofollow noreferrer">https://gist.github.com/JacobAmar/8c45e98f9c34bfd662b9fd11a534b9d5</a></p>
<p>im getting this error when im installing the chart
&quot;parse error at (clientmodule/templates/deployment.yaml:51): unexpected EOF&quot;</p>
<p>also i want to pass that customer id to the default command in the container , thanks for the help :)</p>

Jacob Amar
<p>Ok , so i found a solution to to why helm is only creating a deployment for my last item in the list , helm uses &quot;---&quot; as a seprator between the specification of your yaml. so now my template looks like this and it works :)</p>
<pre><code>    {{ range .Values.customer.id  }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: &quot;clientmodule-customer-{{ . }}&quot;
  labels:
    {{- include &quot;clientmodule.labels&quot; $ | nindent 4 }}
    customer: &quot;{{ . }}&quot;
spec:
  {{- if not $.Values.autoscaling.enabled }}
  replicas: {{ $.Values.replicaCount }}
  {{- end }}
  selector:
    matchLabels:
      {{- include &quot;clientmodule.selectorLabels&quot; $ | nindent 6 }}
  template:
    metadata:
      {{- with $.Values.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        {{- include &quot;clientmodule.selectorLabels&quot; $ | nindent 8 }}
    spec:
      {{- with $.Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ include &quot;clientmodule.serviceAccountName&quot; $ }}
      securityContext:
        {{- toYaml $.Values.podSecurityContext | nindent 8 }}
      containers:
        - name: clientmodule-customer-{{ . }}
          securityContext:
            {{- toYaml $.Values.securityContext | nindent 12 }}
          image: &quot;{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}&quot;
          imagePullPolicy: {{ $.Values.image.pullPolicy }}
          command: [&quot;sh&quot;,&quot;-c&quot;,{{$.Values.command}}]
          resources:
            {{- toYaml $.Values.resources | nindent 12 }}
      {{- with $.Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with $.Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with $.Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
        {{- end }}
---
{{- end }}
</code></pre>
<p>you can refer to this answer too : <a href="https://stackoverflow.com/questions/51024074/how-can-i-iteratively-create-pods-from-list-using-helm/51025501">looping over helm</a></p>
