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

前端 未结 4 1954
被撕碎了的回忆
被撕碎了的回忆 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:40

    The use of --dry-run and --validate only seem to partially solve the issue.

    client-side validation is not exhaustive. it primarily ensures the fields names and types in the yaml file are valid. full validation is always done by the server, and can always impose additional restrictions/constraints over client-side validation.

    Source - kubectl --validate flag pass when yaml file is wrong #64830

    Given this you cannot do a full set of validations except to hand it off completely to the server for vetting.

提交回复
热议问题