@@ -13,7 +13,6 @@ $ echo $?
13131 
1414``` 
1515
16- 
1716## Strict schemas  
1817
1918The Kubernetes API allows for specifying properties on objects that are not part of the schemas.
@@ -34,14 +33,13 @@ $ echo $?
3433
3534If you're using ` kubectl `  you may find it useful to always set the ` --strict `  flag.
3635
37- 
3836## Stdin  
3937
4038Alternatively Kubeval can also take input via ` stdin `  which can make using
4139it as part of an automated pipeline easier by removing the need to securely
4240manage temporary files.
4341
44- ``` 
42+ ``` console 
4543$ cat my-invalid-rc.yaml |  kubeval 
4644The document stdin contains an invalid ReplicationController 
4745--> spec.replicas: Invalid type. Expected: integer, given: string 
@@ -52,22 +50,21 @@ $ echo $?
5250To make the output of pipelines more readable, a filename can be injected
5351to replace ` stdin `  in the output:
5452
55- ``` 
53+ ``` console 
5654$ cat my-invalid-rc.yaml |  kubeval --filename=" my-invalid-rc.yaml"  
5755The document my-invalid-rc.yaml contains an invalid ReplicationController 
5856--> spec.replicas: Invalid type. Expected: integer, given: string 
5957$ echo  $? 
60581 
6159``` 
6260
63- 
6461## CRDs  
6562
6663Currently kubeval relies on schemas generated from the Kubernetes API. This means it's not
6764possible to validate resources using CRDs. Currently you need to pass a flag to ignore
6865missing schemas, though this may change in a future major version.
6966
70- ``` 
67+ ``` console 
7168$ kubeval --ignore-missing-schemas fixtures/test_crd.yaml 
7269Warning: Set to ignore missing schemas 
7370The file fixtures/test_crd.yaml containing a SealedSecret was not validated against a schema 
@@ -76,12 +73,11 @@ The file fixtures/test_crd.yaml containing a SealedSecret was not validated agai
7673If you would prefer to be more explicit about which custom resources to skip you can instead
7774provide a list of resources to skip like so.
7875
79- ``` 
76+ ``` console 
8077$ kubeval --skip-kinds SealedSecret fixtures/test_crd.yam 
8178The file fixtures/test_crd.yaml containing a SealedSecret was not validated against a schema 
8279``` 
8380
84- 
8581## Helm  
8682
8783Helm chart configurations generally have a reference to the source template in a comment
@@ -102,38 +98,38 @@ The file chart/templates/primary.yaml contains a valid ReplicationControlle
10298
10399## Configuring Output  
104100
105-   The output of ` kubeval `  can be configured using the ` --output `  flag (` -o ` ).
101+ The output of ` kubeval `  can be configured using the ` --output `  flag (` -o ` ).
106102
107-   As of today ` kubeval `  supports the following output types:
103+ As of today ` kubeval `  supports the following output types:
108104
109-   -  Plaintext ` --output=stdout ` 
105+ -  Plaintext ` --output=stdout ` 
110106-  JSON: ` --output=json ` 
111107-  TAP: ` --output=tap ` 
112108
113-   ### Example Output 
109+ ### Example Output  
114110
115-   #### Plaintext 
111+ #### Plaintext  
116112
117-   ``` console 
113+ ``` console 
118114$ kubeval my-invalid-rc.yaml 
119115The document my-invalid-rc.yaml contains an invalid ReplicationController 
120116--> spec.replicas: Invalid type. Expected: integer, given: string 
121117``` 
122118
123-   #### JSON 
124- 
125-   ``` console 
126-   $ kubeval fixtures/invalid.yaml -o json
127-   [
128-           { 
129-                   "filename": "fixtures/invalid.yaml", 
130-                   "kind": "ReplicationController", 
131-                   "status": "invalid", 
132-                   "errors": [ 
133-                           "spec.replicas: Invalid type. Expected: [integer,null], given: string" 
134-                   ] 
135-           } 
136-   ]
119+ #### JSON  
120+ 
121+ ``` console 
122+ $ kubeval fixtures/invalid.yaml -o json 
123+ [ 
124+      { 
125+              "filename": "fixtures/invalid.yaml", 
126+              "kind": "ReplicationController", 
127+              "status": "invalid", 
128+              "errors": [ 
129+                      "spec.replicas: Invalid type. Expected: [integer,null], given: string" 
130+              ] 
131+      } 
132+ ] 
137133``` 
138134
139135#### TAP  
@@ -144,7 +140,6 @@ The document my-invalid-rc.yaml contains an invalid ReplicationController
144140not ok 1 - fixtures/invalid.yaml (ReplicationController) - spec.replicas: Invalid type. Expected: [integer,null], given: string 
145141``` 
146142
147- 
148143## Full usage instructions  
149144
150145``` console 
@@ -172,16 +167,16 @@ Flags:
172167
173168The command has three important features:
174169
175- *  You can pass one or more files as arguments, including using wildcard
170+ -  You can pass one or more files as arguments, including using wildcard
176171  expansion. Each file will be validated in turn, and ` kubeval `  will
177172  exit with a non-zero code if _ any_  of the files fail validation.
178- *  You can toggle between the upstream Kubernetes definitions and the
173+ -  You can toggle between the upstream Kubernetes definitions and the
179174  expanded OpenShift ones using the ` --openshift `  flag. The default is
180175  to use the upstream Kubernetes definitions.
181- *  You can pass a version of Kubernetes or OpenShift and the relevant
176+ -  You can pass a version of Kubernetes or OpenShift and the relevant
182177  type schemas for that version will be used. For instance:
183178
184- ``` 
179+ ``` console 
185180$ kubeval -v 1.6.6 my-deployment.yaml 
186181$ kubeval --openshift -v 1.5.1 my-deployment.yaml 
187182``` 
0 commit comments