Merge pull request #15456 from feihujiang/changeConfiguringContainerDoc

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2016-03-02 01:23:58 -08:00
commit 62b87b14e7
1 changed files with 3 additions and 9 deletions

View File

@ -94,21 +94,15 @@ pods/hello-world
## Validating configuration
If youre not sure you specified the resource correctly, you can ask `kubectl` to validate it for you:
```console
$ kubectl create -f ./hello-world.yaml --validate
```
We enable validation by default in `kubectl` since v1.1.
Lets say you specified `entrypoint` instead of `command`. Youd see output as follows:
```console
I0709 06:33:05.600829 14160 schema.go:126] unknown field: entrypoint
I0709 06:33:05.600988 14160 schema.go:129] this may be a false alarm, see http://issue.k8s.io/6842
pods/hello-world
error validating "./hello-world.yaml": error validating data: found invalid field Entrypoint for v1.Container; if you choose to ignore these errors, turn validation off with --validate=false
```
`kubectl create --validate` currently warns about problems it detects, but creates the resource anyway, unless a required field is absent or a field value is invalid. Unknown API fields are ignored, so be careful. This pod was created, but with no `command`, which is an optional field, since the image may specify an `Entrypoint`.
Using `kubectl create --validate=false` to turn validation off, it creates the resource anyway, unless a required field is absent or a field value is invalid. Unknown API fields are ignored, so be careful. This pod was created, but with no `command`, which is an optional field, since the image may specify an `Entrypoint`.
View the [Pod API
object](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/docs/api-reference/v1/definitions.html#_v1_pod)
to see the list of valid fields.