k8s的yaml文件格式错误

问题描述:error: error parsing deploy.yaml.c: error converting YAML to JSON: yaml: line 4: found character that cannot start any token
翻译:错误:分析deploy.yaml时出错。c: 将YAML转换为JSON时出错:YAML:line4:发现无法启动任何标记的字符
原因:在yaml语法中不支持制表符
解决:将制表符换成空格符
借鉴:https://www.cnblogs.com/z-books/p/14202838.html

问题描述:The Deployment “hello-deploy” is invalid: spec.template.spec.containers[0].name: Invalid value: “helloPod”: a DNS-1123 label must consist of lower case alphanumeric characters or ‘-’, and must start and end with an alphanumeric character (e.g. ‘my-name’, or ‘123-abc’, regex used for validation is ‘a-z0-9?’)
愿因:文件格式错误
解决: Invalid value: "helloPod"将helloPod修改成hellopod解决错误

问题描述:error converting YAML to JSON: yaml: line 3: mapping values are not allowed in this context
翻译:错误:分析部署时出错。yaml:将yaml转换为JSON时出错:yaml:第3行:此上下文中不允许映射值
原因:冒号后面没有空格导致
解决:文件中的每个空格后面加空格。

借鉴:https://www.cnblogs.com/z-books/p/14202838.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值