mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
696_add_documentation
This commit is contained in:
parent
c65136c4d7
commit
971008e1c8
2 changed files with 55 additions and 0 deletions
|
@ -129,6 +129,7 @@ Refer to a list of curated of ***[sample policies](/samples/README.md)*** that c
|
||||||
* [Background Processing](documentation/writing-policies-background.md)
|
* [Background Processing](documentation/writing-policies-background.md)
|
||||||
* [Testing Policies](documentation/testing-policies.md)
|
* [Testing Policies](documentation/testing-policies.md)
|
||||||
* [Policy Violations](documentation/policy-violations.md)
|
* [Policy Violations](documentation/policy-violations.md)
|
||||||
|
* [Kubectl plugin usage](documentation/cli-usage.md)
|
||||||
* [Sample Policies](/samples/README.md)
|
* [Sample Policies](/samples/README.md)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
54
documentation/cli-usage.md
Normal file
54
documentation/cli-usage.md
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<small>*[documentation](/README.md#documentation) / kyverno-cli*</small>
|
||||||
|
|
||||||
|
|
||||||
|
# [kyverno CLI](https://github.com/nirmata/kyverno/releases) - kubectl plugin to deal with kyverno policies
|
||||||
|
Used to validate policies and apply policies on resources.
|
||||||
|
|
||||||
|
##Installation
|
||||||
|
You can get the installation package of the cli for your os in the releases page [here](https://github.com/nirmata/kyverno/releases).
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
If you have installed the kubectl plugin manager `krew` you can install the cli using the command
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl krew install kyverno
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
#### Version
|
||||||
|
Prints the version of kyverno used by the CLI.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
kubectl kyverno version
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Validate
|
||||||
|
Validates a policy, can validate multiple files or even an entire folder containing files. Currently supports files files
|
||||||
|
with resource description in yaml.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
kubectl kyverno validate /path/to/policy1.yaml /path/to/policy2.yaml /path/to/folderFullOfPolicies
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Apply
|
||||||
|
Applies policies on resources, supports applying multiple policies on multiple resources in a single command.
|
||||||
|
Also supports applying the given policies to an entire cluster. Will return output to stdout. You may want to redirect
|
||||||
|
output to a file in case you applied a policy to a cluster.
|
||||||
|
|
||||||
|
Apply to a resource:
|
||||||
|
```
|
||||||
|
kubectl kyverno apply /path/to/policy.yaml --resource /path/to/resource.yaml
|
||||||
|
```
|
||||||
|
Apply to a cluster:
|
||||||
|
```
|
||||||
|
kubectl kyverno apply /path/to/policy.yaml --cluster
|
||||||
|
```
|
||||||
|
Valid command with further complexity:
|
||||||
|
```
|
||||||
|
kubectl kyverno apply /path/to/policy1.yaml /path/to/folderFullOfPolicies --resource /path/to/resource1.yaml --resource /path/to/resource2.yaml --cluster
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue