服务:v1.Service.Spec:v1.ServiceSpec.Selector:ReadString:期望为“或n,但找到

时间:2019-05-30 15:36:21

标签: kubernetes

kubectl create -f redis.yaml
Error from server (BadRequest): error when creating "redis.yaml": Service in version "v1" cannot be handled as a Service: v1.Service.Spec: v1.ServiceSpec.Selector: ReadString: expects " or n, but found t, error found in #10 byte of ...|service":true}}}
|..., bigger context ...|79,"protocol":"TCP"}],"selector":{"redisservice":true}}}
|...

此错误是什么意思?

apiVersion: v1
kind: Service
metadata:
  name: redis
spec:
  selector:
    redis-service: yes
  ports:
  - protocol: TCP
    port: 6379
  - protocol: TCP
    port: 26379
  - protocol: TCP
    port: 16379

1 个答案:

答案 0 :(得分:0)

Yaml yes值计算为布尔值。所以应该引用...

redis-service: "yes"