1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

update CLI doc

This commit is contained in:
Jim Bugwadia 2019-05-22 20:02:19 -07:00
parent 4f56e60f8d
commit 4eea73ab60
4 changed files with 38 additions and 5 deletions

View file

@ -20,8 +20,41 @@ kubectl get -f CM.yaml -o yaml
## Test using the Kyverno CLI
*This feature will be available soon*
The Kyverno Command Line Interface (CLI) tool enables writing and testing policies without requiring Kubernetes clusters and without having to apply local policy changes to a cluster.
## Autotest
### Building the CLI
*Will be available after Kyverno CLI is implemented*
You will need a [Go environment](https://golang.org/doc/install) setup.
1. Clone the Kyverno repo
````bash
git clone https://github.com/nirmata/kyverno/
````
2. Build the CLI
````bash
cd kyverno/cmd
go build
````
Or, you can directly build and install the CLI using `go get`:
````bash
go get -u https://github.com/nirmata/kyverno/cmd
````
### Using the CLI
To test a policy using the CLI type:
`kyverno <policy> <resource YAML file or folder>`
For example:
```bash
kyverno ../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.

View file

@ -19,12 +19,12 @@ spec :
op: replace
value: "nginx_is_mutated"
validate:
message: "The imagePullPolicy shoud set to Always"
message: "The imagePullPolicy must be Always when :latest is used as a tag"
pattern:
spec:
template:
spec:
containers:
- (name): "*"
- (name): "*:latest"
imagePullPolicy: Always