Failing Kubernetes deployment, expecting char '""' but got char '8'

5/24/2017

I have the following Deployment...

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: socket-server-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: socket-server
    spec:
        containers:
        - name: socket-server
          image: gcr.io/project-haswell-recon/socket-server:production-production-2
          env:
          - name: PORT
            value: 80
          ports:
          - containerPort: 80

But I get the following error when I run kubectl create -f ./scripts/deployment.yml --namespace production

Error from server (BadRequest): error when creating "./scripts/deployment.yml": Deployment in version "v1beta1" cannot be handled as a Deployment: [pos 321]: json: expect char '"' but got char '8'

I pretty much copy and pasted this deployment from a previous working deployment, and altered a few details so I'm at a loss as to what this could be.

-- Ewan Valentine
google-cloud-platform
kubernetes

1 Answer

5/24/2017

The problem is with the number 80. Here it's within an EnvVar context, so it has to be of type string and not int

-- lang2
Source: StackOverflow