From ec41030765b6c18a08a618cf06b047a588d3bafa Mon Sep 17 00:00:00 2001 From: shuting Date: Wed, 12 Jun 2019 16:33:12 -0700 Subject: [PATCH] update doc for CLI --- documentation/testing-policies.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/documentation/testing-policies.md b/documentation/testing-policies.md index b935f05279..a877430846 100644 --- a/documentation/testing-policies.md +++ b/documentation/testing-policies.md @@ -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 ` +`kyverno apply @ @` 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.