kubernetes - Service: v1.Service.Spec: v1.ServiceSpec.Selector: ReadString: expects " or n, but found t
问题描述
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}}}
|...
What does this error mean?
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
解决方案
Yamlyes
值计算为布尔值。所以应该引用...
redis-service: "yes"
推荐阅读
- azure - 在 Azure 中创建多个子网
- html - 模态框 - 仅显示框的内部
- python - 如何在kivy中单击按钮时更新MDLabel的文本
- python - 在图像上添加/读取标签 Python
- microsoft-information-protection - MIP SDK 1.10.97 以 -1073740791 静默退出
- python - 如果键存在,则添加嵌套字典的值
- python - 具有多列的数据框的不同聚合
- java - 如何在使用 camera2 api 录制时向视频添加自定义过滤器
- email - 电子邮件模板 | 在主题上方插入自定义 HTML 块
- vue.js - 在构建部署到 S3 后获取环境变量是 Vuejs