简体   繁体   English

失败的Kubernetes部署,期待char'“”'但得到char'8'

[英]Failing Kubernetes deployment, expecting char '“”' but got char '8'

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 但是当我运行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. 我几乎从以前的工作部署中复制并粘贴了这个部署,并改变了一些细节,所以我不知道这可能是什么。

The problem is with the number 80 . 问题在于数字80 Here it's within an EnvVar context, so it has to be of type string and not int 这是在EnvVar上下文中,因此它必须是string类型而不是int

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM