Resource Definitions

Custom Resource Definitions (CRDs) for Kyverno policies and other types.

Kyverno uses Kubernetes Custom Resource Definitions (CRDs) for policy definitions, policy reports, and other internal types.

The complete Kyverno CRD reference can be viewed using this link:

kyverno.io/v1.ClusterPolicy

The HTML source is available in the Kyverno GitHub repository and generated from type definitions stored at kyverno/kyverno/pkg/api.

kubectl explain

When operating in a Kubernetes cluster with Kyverno installed, you can always inspect Kyverno types natively using kubectl explain.

For example, here is the definition of a Kyverno policy.spec:

 1kubectl explain policy.spec
 2KIND:     Policy
 3VERSION:  kyverno.io/v1
 4
 5RESOURCE: spec <Object>
 6
 7DESCRIPTION:
 8     Spec defines policy behaviors and contains one or more rules.
 9
10FIELDS:
11   background   <boolean>
12     Background controls if rules are applied to existing resources during a
13     background scan. Optional. Default value is "true". The value must be set
14     to "false" if the policy rule uses variables that are only available in the
15     admission review request (e.g. user name).
16
17   rules        <[]Object>
18     Rules is a list of Rule instances. A Policy contains multiple rules and
19     each rule can validate, mutate, or generate resources.
20
21   validationFailureAction      <string>
22     ValidationFailureAction controls if a validation policy rule failure should
23     disallow the admission review request (enforce), or allow (audit) the
24     admission review request and report an error in a policy report. Optional.
25     The default value is "audit".

Kyverno’s support for structural schemas also enables integrated help in Kubernetes enabled Integrated Development Environments like VS Code with the Kubernetes Extension installed.


Last modified June 06, 2021 at 8:46 AM PST: updated Resource Definitions #173 (5e1fab9)