• 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 配置属性的时候,经常会有这种配置错误。。 因为缩进, 容易搞错,比如多或少一个空格。
     
     
     
     
     


    版权声明
    本文原创发表于 博客园,作者为 阿K .     本文欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则视为侵权。
    欢迎关注本人微信公众号:觉醒的码农,或者扫码进群:

  • 相关阅读:
    跟我一起学算法——贪心算法
    跟我一起学算法——最大流
    跟我一起学算法——红黑树
    设计模式总结
    敏捷开发模型
    TCP安全,SYN Flooding 和 nmap
    ICMP和重定向攻击
    IP安全,DDoS攻击、tearDrop攻击和微小IP碎片攻击
    Netfilter,获取http明文用户名和密码
    Linux常用网络命令
  • 原文地址:https://www.cnblogs.com/FlyAway2013/p/14301003.html
Copyright © 2020-2023  润新知