You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varDefaultFailurePolicy=flag.String("default-failure-policy", string(admissionv1.Fail), "(beta) Failure policy to use when a K8sNativeValidation source omits failurePolicy. Allowed values are Fail or Ignore.")
Copy file name to clipboardExpand all lines: website/docs/runtime-flags.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ The following flags can be used to configure Gatekeeper's runtime behavior:
37
37
|`--log-stats-audit`|`false`| (alpha) Log stats metrics for the audit run. |
38
38
|`--default-create-vap-binding-for-constraints`|`true`| (beta) Create VAPBinding resource for constraint of the template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy Binding, true: create Validating Admission Policy Binding. |
39
39
|`--default-create-vap-for-templates`|`true`| (beta) Create VAP resource for template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy unless generateVAP: true is set on constraint template explicitly, true: create Validating Admission Policy unless generateVAP: false is set on constraint template explicitly. |
40
+
|`--default-failure-policy`|`Fail`| (beta) Failure policy to use when a K8sNativeValidation source omits failurePolicy. Allowed values are Fail or Ignore. |
40
41
|`--default-wait-for-vapb-generation`|`30`| (beta) Wait time in seconds before generating a ValidatingAdmissionPolicyBinding after a constraint CRD is created. |
41
42
|`--debug-use-fake-pod`|`false`| Use a fake pod name so the Gatekeeper executable can be run outside of Kubernetes. |
42
43
|`--enable-violation-export`|`false`| (alpha) Enable exporting violations to external systems. |
Copy file name to clipboardExpand all lines: website/docs/validating-admission-policy.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,8 @@ For some policies, you may want admission requests to be handled by the K8s Vali
120
120
The K8s Validating Admission Controller requires both the Validating Admission Policy (VAP) and Validating Admission Policy Binding (VAPB) resources to exist to enforce a policy. Gatekeeper can be configured to generate both of these resources. To generate VAP Bindings for all Constraints, ensure the Gatekeeper
121
121
`--default-create-vap-binding-for-constraints` flag is set to `true`. To generate VAP as part of all Constraint Templates with the VAP CEL engine `K8sNativeValidation`, ensure the Gatekeeper `--default-create-vap-for-templates=true` flag is set to `true`. By default both flags are set to `true` now that the feature is in beta.
122
122
123
+
If a K8sNativeValidation source omits `failurePolicy`, Gatekeeper uses `--default-failure-policy`, which defaults to `Fail`, for both Gatekeeper's CEL evaluation and generated VAP resources.
124
+
123
125
To override the `--default-create-vap-for-templates` flag's behavior for a constraint template, set `generateVAP` to `true` explicitly under the K8sNativeValidation engine's `source` in the constraint template.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-v3.22.x/runtime-flags.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ The following flags can be used to configure Gatekeeper's runtime behavior:
37
37
|`--log-stats-audit`|`false`| (alpha) Log stats metrics for the audit run. |
38
38
|`--default-create-vap-binding-for-constraints`|`true`| (beta) Create VAPBinding resource for constraint of the template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy Binding, true: create Validating Admission Policy Binding. |
39
39
|`--default-create-vap-for-templates`|`true`| (beta) Create VAP resource for template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy unless generateVAP: true is set on constraint template explicitly, true: create Validating Admission Policy unless generateVAP: false is set on constraint template explicitly. |
40
+
|`--default-failure-policy`|`Fail`| (beta) Failure policy to use when a K8sNativeValidation source omits failurePolicy. Allowed values are Fail or Ignore. |
40
41
|`--default-wait-for-vapb-generation`|`30`| (beta) Wait time in seconds before generating a ValidatingAdmissionPolicyBinding after a constraint CRD is created. |
41
42
|`--debug-use-fake-pod`|`false`| Use a fake pod name so the Gatekeeper executable can be run outside of Kubernetes. |
42
43
|`--enable-violation-export`|`false`| (alpha) Enable exporting violations to external systems. |
Copy file name to clipboardExpand all lines: website/versioned_docs/version-v3.22.x/validating-admission-policy.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,8 @@ For some policies, you may want admission requests to be handled by the K8s Vali
120
120
The K8s Validating Admission Controller requires both the Validating Admission Policy (VAP) and Validating Admission Policy Binding (VAPB) resources to exist to enforce a policy. Gatekeeper can be configured to generate both of these resources. To generate VAP Bindings for all Constraints, ensure the Gatekeeper
121
121
`--default-create-vap-binding-for-constraints` flag is set to `true`. To generate VAP as part of all Constraint Templates with the VAP CEL engine `K8sNativeValidation`, ensure the Gatekeeper `--default-create-vap-for-templates=true` flag is set to `true`. By default both flags are set to `true` now that the feature is in beta.
122
122
123
+
If a K8sNativeValidation source omits `failurePolicy`, Gatekeeper uses `--default-failure-policy`, which defaults to `Fail`, for both Gatekeeper's CEL evaluation and generated VAP resources.
124
+
123
125
To override the `--default-create-vap-for-templates` flag's behavior for a constraint template, set `generateVAP` to `true` explicitly under the K8sNativeValidation engine's `source` in the constraint template.
0 commit comments