Possible to do a “dry run” validation of files?

前端 未结 4 1946
被撕碎了的回忆
被撕碎了的回忆 2021-02-12 03:58

Before creating an object in Kubernetes (Service, ReplicationController, etc.), I\'d like to test that the JSON or YAML specification of the object is valid. But I don\'t want t

4条回答
  •  滥情空心
    2021-02-12 04:19

    This works for me (kubernetes 1.7 and 1.9):

    kubectl apply --validate=true --dry-run=true --filename=task.yaml
    

提交回复
热议问题