yml错误:层级、缩进不对引起的问题
persistentvolume/nfs-pv1 created
error: error parsing redis-pv.yaml: error converting YAML to JSON: yaml: line 8: did not find expected key
[root@master ~]# kubectl delete -f redis-pv.yaml
error: error parsing redis-pv.yaml: error converting YAML to JSON: yaml: line 10: did not find expected key
[root@master ~]# kubectl delete -f redis-pv.yaml
persistentvolume "nfs-pv1" deleted
error: error parsing redis-pv.yaml: error converting YAML to JSON: yaml: line 8: did not find expected key
[root@master ~]# kubectl delete -f redis-pv.yaml
# kubectl apply -f redis-headless-service.yaml
error: error validating "redis-headless-service.yaml": error validating data: ValidationError(Service): unknown field "app" in io.v1.Service; if you choose to ignore these errors, turn validation off with --validate=false
[root@master ~]# kubectl create -f redis.yaml
error: error validating "redis.yaml": error validating data: ValidationError(plate.spec.volumes[0].configMap): unknown field "volumeClaimTemplates" in io.v1.ConfigMapVolumeSource; if you choose to ignore these errors, turn validation off with --validate=false volumeClaimTemplates 不属于 plate.spec.volumes
[root@master ~]# kubectl create -f redis.yaml
error: error validating "redis.yaml": error validating data: ValidationError(plate.spec): unknown field "volumeClaimTemplates" in io.v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false
volumeClaimTemplates 也不属于 plate.spec
volumeClaimTemplates 直接属于 StatefulSet.spec !!
不熟悉 yml 配置属性的时候,经常会有这种配置错误。。因为缩进,容易搞错,⽐如多或少⼀个空格。
validation框架
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论