Skip to main content
Version: Next 🚧

You can find the definitions for the Kubewarden Custom Resources both on this page and here at docs.crds.dev.

API Reference

Packages

policies.kubewarden.io/v1

Package v1 contains API Schema definitions for the policies v1 API group

Resource Types

AdmissionPolicy

AdmissionPolicy is the Schema for the admissionpolicies API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringAdmissionPolicy
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec AdmissionPolicySpec

AdmissionPolicyList

AdmissionPolicyList contains a list of AdmissionPolicy

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringAdmissionPolicyList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items AdmissionPolicy array

AdmissionPolicySpec

AdmissionPolicySpec defines the desired state of AdmissionPolicy

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://). If prefix is missing, it will default to registry:// and use that internally.
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
backgroundAudit booleanBackgroundAudit indicates whether a policy should be used or skipped when performing audit checks. If false, the policy cannot produce meaningful evaluation results during audit checks and will be skipped. The default is "true".
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.

ClusterAdmissionPolicy

ClusterAdmissionPolicy is the Schema for the clusteradmissionpolicies API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringClusterAdmissionPolicy
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ClusterAdmissionPolicySpec

ClusterAdmissionPolicyList

ClusterAdmissionPolicyList contains a list of ClusterAdmissionPolicy

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringClusterAdmissionPolicyList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items ClusterAdmissionPolicy array

ClusterAdmissionPolicySpec

ClusterAdmissionPolicySpec defines the desired state of ClusterAdmissionPolicy

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://). If prefix is missing, it will default to registry:// and use that internally.
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
backgroundAudit booleanBackgroundAudit indicates whether a policy should be used or skipped when performing audit checks. If false, the policy cannot produce meaningful evaluation results during audit checks and will be skipped. The default is "true".
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.
namespaceSelector LabelSelectorNamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.

For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows:
 "namespaceSelector": {
  "matchExpressions": [
    {
      "key": "runlevel",
      "operator": "NotIn",
      "values": [
        "0",
        "1"
      ]
    }
  ]
}
If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows:
 "namespaceSelector": {
  "matchExpressions": [
    {
      "key": "environment",
      "operator": "In",
      "values": [
        "prod",
        "staging"
      ]
    }
  ]
}
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors.

Default to the empty LabelSelector, which matches everything.
contextAwareResources ContextAwareResource arrayList of Kubernetes resources the policy is allowed to access at evaluation time. Access to these resources is done using the ServiceAccount of the PolicyServer the policy is assigned to.

ContextAwareResource

ContextAwareResource identifies a Kubernetes resource

Appears in:

FieldDescription
apiVersion stringapiVersion of the resource (v1 for core group, groupName/groupVersions for other).
kind stringSingular PascalCase name of the resource

PolicyMode

Underlying type: string

Appears in:

PolicyModeStatus

Underlying type: string

Appears in:

PolicyServer

PolicyServer is the Schema for the policyservers API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringPolicyServer
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec PolicyServerSpec

PolicyServerList

PolicyServerList contains a list of PolicyServer

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1
kind stringPolicyServerList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items PolicyServer array

PolicyServerSecurity

PolicyServerSecurity defines securityContext configuration to be used in the Policy Server workload

Appears in:

FieldDescription
container SecurityContextsecurityContext definition to be used in the policy server container
pod PodSecurityContextpodSecurityContext definition to be used in the policy server Pod

PolicyServerSpec

PolicyServerSpec defines the desired state of PolicyServer

Appears in:

FieldDescription
image stringDocker image name.
replicas integerReplicas is the number of desired replicas.
annotations object (keys:string, values:string)Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
env EnvVar arrayList of environment variables to set in the container.
serviceAccountName stringName of the service account associated with the policy server. Namespace service account will be used if not specified.
imagePullSecret stringName of ImagePullSecret secret in the same namespace, used for pulling policies from repositories.
insecureSources string arrayList of insecure URIs to policy repositories.
sourceAuthorities object (keys:string, values:string array)Key value map of registry URIs endpoints to a list of their associated PEM encoded certificate authorities that have to be used to verify the certificate used by the endpoint.
verificationConfig stringName of VerificationConfig configmap in the same namespace, containing Sigstore verification configuration. The configuration must be under a key named verification-config in the Configmap.
securityContexts PolicyServerSecuritySecurity configuration to be used in the Policy Server workload. The field allows different configurations for the pod and containers. This configuration will not be used in containers added by other controllers (e.g. telemetry sidecars)

PolicySpec

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://). If prefix is missing, it will default to registry:// and use that internally.
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
backgroundAudit booleanBackgroundAudit indicates whether a policy should be used or skipped when performing audit checks. If false, the policy cannot produce meaningful evaluation results during audit checks and will be skipped. The default is "true".
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.

PolicyStatusEnum

Underlying type: string

Appears in:

policies.kubewarden.io/v1alpha2

Package v1alpha2 contains API Schema definitions for the policies v1alpha2 API group

Resource Types

AdmissionPolicy

AdmissionPolicy is the Schema for the admissionpolicies API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringAdmissionPolicy
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec AdmissionPolicySpec

AdmissionPolicyList

AdmissionPolicyList contains a list of AdmissionPolicy

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringAdmissionPolicyList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items AdmissionPolicy array

AdmissionPolicySpec

AdmissionPolicySpec defines the desired state of AdmissionPolicy

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://).
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.

ClusterAdmissionPolicy

ClusterAdmissionPolicy is the Schema for the clusteradmissionpolicies API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringClusterAdmissionPolicy
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ClusterAdmissionPolicySpec

ClusterAdmissionPolicyList

ClusterAdmissionPolicyList contains a list of ClusterAdmissionPolicy

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringClusterAdmissionPolicyList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items ClusterAdmissionPolicy array

ClusterAdmissionPolicySpec

ClusterAdmissionPolicySpec defines the desired state of ClusterAdmissionPolicy

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://).
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.
namespaceSelector LabelSelectorNamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.

For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows:
 "namespaceSelector": {
  "matchExpressions": [
    {
      "key": "runlevel",
      "operator": "NotIn",
      "values": [
        "0",
        "1"
      ]
    }
  ]
}
If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows:
 "namespaceSelector": {
  "matchExpressions": [
    {
      "key": "environment",
      "operator": "In",
      "values": [
        "prod",
        "staging"
      ]
    }
  ]
}
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors.

Default to the empty LabelSelector, which matches everything.

PolicyMode

Underlying type: string

Appears in:

PolicyModeStatus

Underlying type: string

Appears in:

PolicyServer

PolicyServer is the Schema for the policyservers API

Appears in:

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringPolicyServer
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec PolicyServerSpec

PolicyServerList

PolicyServerList contains a list of PolicyServer

FieldDescription
apiVersion stringpolicies.kubewarden.io/v1alpha2
kind stringPolicyServerList
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items PolicyServer array

PolicyServerSpec

PolicyServerSpec defines the desired state of PolicyServer

Appears in:

FieldDescription
image stringDocker image name.
replicas integerReplicas is the number of desired replicas.
annotations object (keys:string, values:string)Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
env EnvVar arrayList of environment variables to set in the container.
serviceAccountName stringName of the service account associated with the policy server. Namespace service account will be used if not specified.
imagePullSecret stringName of ImagePullSecret secret in the same namespace, used for pulling policies from repositories.
insecureSources string arrayList of insecure URIs to policy repositories.
sourceAuthorities object (keys:string, values:string array)Key value map of registry URIs endpoints to a list of their associated PEM encoded certificate authorities that have to be used to verify the certificate used by the endpoint.
verificationConfig stringName of VerificationConfig configmap in the same namespace, containing Sigstore verification configuration. The configuration must be under a key named verification-config in the Configmap.

PolicySpec

Appears in:

FieldDescription
policyServer stringPolicyServer identifies an existing PolicyServer resource.
module stringModule is the location of the WASM module to be loaded. Can be a local file (file://), a remote file served by an HTTP server (http://, https://), or an artifact served by an OCI-compatible registry (registry://).
mode PolicyModeMode defines the execution mode of this policy. Can be set to either "protect" or "monitor". If it's empty, it is defaulted to "protect". Transitioning this setting from "monitor" to "protect" is allowed, but is disallowed to transition from "protect" to "monitor". To perform this transition, the policy should be recreated in "monitor" mode instead.
settings RawExtensionSettings is a free-form object that contains the policy configuration values. x-kubernetes-embedded-resource: false
rules RuleWithOperations arrayRules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches any Rule.
failurePolicy FailurePolicyTypeFailurePolicy defines how unrecognized errors and timeout errors from the policy are handled. Allowed values are "Ignore" or "Fail". * "Ignore" means that an error calling the webhook is ignored and the API request is allowed to continue. * "Fail" means that an error calling the webhook causes the admission to fail and the API request to be rejected. The default behaviour is "Fail"
mutating booleanMutating indicates whether a policy has the ability to mutate incoming requests or not.
matchPolicy MatchPolicyTypematchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
  • Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  • Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"], a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
Defaults to "Equivalent"
objectSelector LabelSelectorObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
sideEffects SideEffectClassSideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
timeoutSeconds integerTimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.

PolicyStatusEnum

Underlying type: string

Appears in: