1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

Merge pull request from nirmata/166_CLI_document

update doc for CLI
This commit is contained in:
Jim Bugwadia 2019-06-12 18:29:03 -07:00 committed by GitHub
commit e36750a064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions
definitions
documentation
scripts

View file

@ -176,7 +176,6 @@ spec:
containers:
- name: kyverno
image: nirmata/kyverno:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 443
securityContext:

View file

@ -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.

2
scripts/cleanup.sh Executable file
View file

@ -0,0 +1,2 @@
kubectl delete -f definitions/install.yaml
kubectl delete csr,MutatingWebhookConfiguration,ValidatingWebhookConfiguration --all