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.k8s.api.core.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(StatefulSet.spec.template.spec.volumes[0].configMap): unknown field "volumeClaimTemplates" in io.k8s.api.core.v1.ConfigMapVolumeSource; if you choose to ignore these errors, turn validation off with --validate=false
 
volumeClaimTemplates 不屬於 StatefulSet.spec.template.spec.volumes
 
[root@master ~]# kubectl create -f redis.yaml
error: error validating "redis.yaml": error validating data: ValidationError(StatefulSet.spec.template.spec): unknown field "volumeClaimTemplates" in io.k8s.api.core.v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false
 
volumeClaimTemplates 也不屬於 StatefulSet.spec.template.spec
 
 
volumeClaimTemplates 直接屬於 StatefulSet.spec !!
 
不熟悉 yml 配置屬性的時候,經常會有這種配置錯誤。。 因為縮進, 容易搞錯,比如多或少一個空格。
 
 
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM