Skip to content

Commit 342415b

Browse files
author
Brendan Ryan
committed
move docs to docs
1 parent ccbc242 commit 342415b

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

README.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,4 @@ $ echo $?
1818
1
1919
```
2020

21-
## Configuring Output
22-
23-
The output of `kubeval` can be configured using the `--output` flag (`-o`).
24-
25-
As of today `kubeval` supports the following output types:
26-
27-
- Plaintext `--output=stdout`
28-
- JSON: `--output=json`
29-
30-
#### Example Output
31-
32-
##### Plaintext
33-
34-
```console
35-
$ kubeval my-invalid-rc.yaml
36-
The document my-invalid-rc.yaml contains an invalid ReplicationController
37-
--> spec.replicas: Invalid type. Expected: integer, given: string
38-
```
39-
40-
##### JSON
41-
42-
```console
43-
$ kubeval fixtures/invalid.yaml -o json
44-
[
45-
{
46-
"filename": "fixtures/invalid.yaml",
47-
"kind": "ReplicationController",
48-
"status": "invalid",
49-
"errors": [
50-
"spec.replicas: Invalid type. Expected: [integer,null], given: string"
51-
]
52-
}
53-
]
54-
```
55-
5621
For full usage and installation instructions see [kubeval.instrumenta.dev](https://kubeval.instrumenta.dev/).

docs/index.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,57 @@ The file fixtures/test_crd.yaml containing a SealedSecret was not validated agai
8787
Helm chart configurations generally have a reference to the source template in a comment
8888
like so:
8989

90-
```
90+
```console
9191
# Source: chart/templates/frontend.yam
9292
```
9393

9494
When kubeval detects these comments it will report the relevant chart template files in
9595
the output.
9696

97-
```
97+
```console
9898
$ kubeval fixtures/multi_valid_source.yaml
9999
The file chart/templates/primary.yaml contains a valid Service
100100
The file chart/templates/primary.yaml contains a valid ReplicationControlle
101101
```
102102

103+
## Configuring Output
103104

104-
## Full usage instructions
105+
The output of `kubeval` can be configured using the `--output` flag (`-o`).
105106

107+
As of today `kubeval` supports the following output types:
108+
109+
- Plaintext `--output=stdout`
110+
- JSON: `--output=json`
111+
112+
### Example Output
113+
114+
#### Plaintext
115+
116+
```console
117+
$ kubeval my-invalid-rc.yaml
118+
The document my-invalid-rc.yaml contains an invalid ReplicationController
119+
--> spec.replicas: Invalid type. Expected: integer, given: string
120+
```
121+
122+
#### JSON
123+
124+
```console
125+
$ kubeval fixtures/invalid.yaml -o json
126+
[
127+
{
128+
"filename": "fixtures/invalid.yaml",
129+
"kind": "ReplicationController",
130+
"status": "invalid",
131+
"errors": [
132+
"spec.replicas: Invalid type. Expected: [integer,null], given: string"
133+
]
134+
}
135+
]
106136
```
137+
138+
## Full usage instructions
139+
140+
```console
107141
$ kubeval --help
108142
Validate a Kubernetes YAML file against the relevant schema
109143

@@ -119,7 +153,8 @@ Flags:
119153
--ignore-missing-schemas Skip validation for resource definitions without a schema
120154
-v, --kubernetes-version string Version of Kubernetes to validate against (default "master")
121155
--openshift Use OpenShift schemas instead of upstream Kubernetes
122-
--schema-location string Base URL used to download schemas. Can also be specified with the environment variable KUBEVAL_SCHEMA_LOCATION (default "https://kubernetesjsonschema.dev")
156+
-o, --output string The format of the output of this script. Options are: [stdout json]
157+
--schema-location string Base URL used to download schemas. Can also be specified with the environment variable KUBEVAL_SCHEMA_LOCATION
123158
--skip-kinds strings Comma-separated list of case-sensitive kinds to skip when validating against schemas
124159
--strict Disallow additional properties not in schema
125160
--version version for kubeval

0 commit comments

Comments
 (0)