在利用k8s重启yaml
文件时,遇到报错did not find expected '-' indicator
。
在此记录一下,以后如果遇到其他的问题,会继续在这里进行记录!
问题:did not find expected '-' indicator
#kubectl delete -f k8s-dosec-web.yaml
service "dosec-web" deleted
error: error parsing k8s-dosec-web.yaml: error converting YAML to JSON: yaml: line 73: did not find expected '-' indicator
#kubectl apply -f k8s-dosec-web.yaml
service/dosec-web created
error: error parsing k8s-dosec-web.yaml: error converting YAML to JSON: yaml: line 73: did not find expected '-' indicator
目前猜测是因为k8s-dosec-web.yaml
文件中的json缩进问题。
进入这个k8s-dosec-web.yaml
。
vim k8s-dosec-web.yaml
修改好缩进问题之后,再次执行上面两个delete
和 apply
命令,没有出现报错的现象。