<p>Is it possible to have array as environmental variable in deployment?</p>
<pre><code>kind: Deployment
metadata:
  name: array-deployment
  namespace: array-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: array-deployment
  template:
    metadata:
      labels:
        app: array-deployment
    spec:
      containers:
      - name: array-deployment
        image: array-deployment:beta
        env:
        - name: ENV_PROJECTS
          value: &quot;project1&quot;
        ports:
        - containerPort: 80
        resources: {}
</code></pre>
<p>For an example, I want to have an array of projects for <code>ENV_PROJECT</code>.</p>

<p>Environment variables are plain strings and do not support arrays as input</p>
<p>In order to achieve what you want, you would want to pass the values as a comma separated list. (You might want to use some other separator if your data contains <code>,</code>)</p>
<p>so your yaml manifest would become</p>
<pre><code>    - name: ENV_PROJECTS
      value: &quot;project1,project2&quot;
</code></pre>
<p>This assumes that your code in the image <code>array-deployment:beta</code> supports reading comma separated values from the env var</p>
