<p>Is there any way to pass array of ports in values.yaml file. I want to have multiple ContainerPorts to be set. I tried with <code>--set &quot;test.containerPort={8080,10102,19905}</code> and got error message as invalid type for io.k8s.apimachinery.pkg.util.intstr.IntOrString: got &quot;array&quot;, expected &quot;string&quot;.</p>
<p>Any example/suggestions will be really helpful.</p>

Chandra Sekar
<p>Helm uses the Go templating mechanism, so it actually takes your parameters from <code>values.yaml</code> and puts them into <code>template/*</code> files.</p>
<p>In other words, the way how you set multiple containers ports depends on the Helm Chart you use.</p>
<p>For example, if had a file <code>template/my-statefulset.yaml</code></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: StatefulSet
...
spec:
  template:
    spec:
      containers:
        ports:
{{ toYaml .Values.ports| indent 10 }}
...
</code></pre>
<p>Then, you could use the following <code>values.yaml</code> to set multiple container ports.</p>
<pre class="lang-yaml prettyprint-override"><code>ports:
  - name: my first port
    containerPort: 5678
  - name: my second port
    containerPort: 5679
</code></pre>
