mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
update doc for CLI
This commit is contained in:
parent
374016025b
commit
ec41030765
1 changed files with 11 additions and 3 deletions
|
@ -49,14 +49,22 @@ go get -u https://github.com/nirmata/kyverno/cmd/kyverno
|
|||
|
||||
### Using the CLI
|
||||
|
||||
The CLI loads default kubeconfig ($HOME/.kube/config) to test policies in Kubernetes cluster. If no kubeconfig is found, the CLI will test policies on raw resources.
|
||||
|
||||
To test a policy using the CLI type:
|
||||
|
||||
`kyverno <policy> <resource YAML file or folder>`
|
||||
`kyverno apply @<policy> @<resource YAML file or folder>`
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
kyverno ../../examples/cli/policy-deployment.yaml ../../examples/cli/resources
|
||||
kyverno apply @../../examples/cli/policy-deployment.yaml @../../examples/cli/resources
|
||||
```
|
||||
|
||||
In future releases, the CLI will support complete validation of policies and will allow testing policies against resources in Kubernetes clusters.
|
||||
To test a policy with the specific kubeconfig:
|
||||
|
||||
```bash
|
||||
kyverno apply @../../examples/cli/policy-deployment.yaml @../../examples/cli/resources --kubeconfig $PATH_TO_KUBECONFIG_FILE
|
||||
```
|
||||
|
||||
In future releases, the CLI will support complete validation and generation of policies.
|
||||
|
|
Loading…
Reference in a new issue