<p>The following <code>yaml</code> file works fine</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: something
spec:
  replicas: 2
  selector:
    matchLabels:
      app: something
  template:
    metadata:
      labels:
        app: something
    spec:
      volumes:
        - name: shared-logs
          emptyDir: {}
      containers:
        - name: something
          image: docker.io/manuchadha25/something
          volumeMounts:
            - name: shared-logs
              mountPath: /deploy/codingjediweb-1.0/logs/
          env:
            - name: DB_CASSANDRA_URI
              value: cassandra://34.91.5.44
            - name: DB_PASSWORD
              value: something
            - name: DB_KEYSPACE_NAME
              value: something
            - name: DB_USERNAME
              value: something
            - name: EMAIL_SERVER
              value: something
            - name: EMAIL_USER
              value: something
            - name: EMAIL_PASSWORD
              value: something
            - name: ALLOWED_NODES
              value: 34.105.134.5  
          ports:
            - containerPort: 9000
        #- name: logging
         # image: busybox
          #volumeMounts:
           # - name: shared-logs
            #  mountPath: /deploy/codingjediweb-1.0/logs/
          #command: ['sh', '-c', &quot;while true; do sleep 86400; done&quot;]
</code></pre>
<p>But when I add the following two lines in <code>env</code> section, I get error</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: something
spec:
  replicas: 2
  selector:
    matchLabels:
      app: something
  template:
    metadata:
      labels:
        app: something
    spec:
      volumes:
        - name: shared-logs
          emptyDir: {}
      containers:
        - name: something
          image: docker.io/manuchadha25/something
          volumeMounts:
            - name: shared-logs
              mountPath: /deploy/codingjediweb-1.0/logs/
          env:
            - name: DB_CASSANDRA_URI
              value: cassandra://34.91.5.44
            - name: DB_CASSANDRA_PORT &lt;--- NEW LINE
              value: 9042&lt;--- NEW LINE
            - name: DB_PASSWORD
              value: something
            - name: DB_KEYSPACE_NAME
              value: something
            - name: DB_USERNAME
              value: something
            - name: EMAIL_SERVER
              value: something
            - name: EMAIL_USER
              value: something
            - name: EMAIL_PASSWORD
              value: something
            - name: ALLOWED_NODES
              value: 34.105.134.5  
          ports:
            - containerPort: 9000
        #- name: logging
         # image: busybox
          #volumeMounts:
           # - name: shared-logs
            #  mountPath: /deploy/codingjediweb-1.0/logs/
          #command: ['sh', '-c', &quot;while true; do sleep 86400; done&quot;]


$ kubectl apply -f codingjediweb-nodes.yaml
Error from server (BadRequest): error when creating &quot;codingjediweb-nodes.yaml&quot;: Deployment in version &quot;v1&quot; cannot be handled as a Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects &quot; or n, but found 9, error found in #10 byte of ...|,&quot;value&quot;:9042},{&quot;nam|..., bigger context ...|.1.85.10&quot;},{&quot;name&quot;:&quot;DB_CASSANDRA_PORT&quot;,&quot;value&quot;:9042},{&quot;name&quot;:&quot;DB_PASSWORD&quot;,&quot;value&quot;:&quot;1GFGc1Q|...
</code></pre>
<p>The following website validates that the YAML is correct.</p>
<p>What am I doing wrong?</p>

Manu Chadha
<p>Could you please add 9042 in double qoutes “9042” and try this. I think it’s looking for string and getting numbers instead so please add the value in double quotes</p>
