## kyverno apply Applies policies on resources. ``` kyverno apply [flags] ``` ### Examples ``` To apply on a resource: kyverno apply /path/to/policy.yaml /path/to/folderOfPolicies --resource=/path/to/resource1 --resource=/path/to/resource2 To apply on a folder of resources: kyverno apply /path/to/policy.yaml /path/to/folderOfPolicies --resource=/path/to/resources/ To apply on a cluster: kyverno apply /path/to/policy.yaml /path/to/folderOfPolicies --cluster To apply policies from a gitSourceURL on a cluster: Example: Taking github.com as a gitSourceURL here. Some other standards gitSourceURL are: gitlab.com , bitbucket.org , etc. kyverno apply https://github.com/kyverno/policies/openshift/ --git-branch main --cluster To apply policy with variables: 1. To apply single policy with variable on single resource use flag "set". Example: kyverno apply /path/to/policy.yaml --resource /path/to/resource.yaml --set =,= 2. To apply multiple policy with variable on multiple resource use flag "values_file". Example: kyverno apply /path/to/policy1.yaml /path/to/policy2.yaml --resource /path/to/resource1.yaml --resource /path/to/resource2.yaml -f /path/to/value.yaml Format of value.yaml: policies: - name: rules: - name: values: : : - name: values: : : resources: - name: values: : : - name: values: : : - name: resources: - name: values: : : - name: values: : : namespaceSelector: - name: labels: