forked from kgateway-dev/kgateway
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.18] feat: Add Match Conditions to the validation webhook (#10569)
Co-authored-by: Nathan Fudenberg <[email protected]> Co-authored-by: changelog-bot <changelog-bot>
- Loading branch information
1 parent
4d967c1
commit 98f32bc
Showing
11 changed files
with
112 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
changelog: | ||
- type: HELM | ||
issueLink: https://github.com/k8sgateway/k8sgateway/issues/9828 | ||
resolvesIssue: false | ||
description: >- | ||
Adds support for match conditions (defined via Common Expression Language (CEL)) to the validating webhook to allow fine grained request filtering. They can be set via two new helm values : | ||
- `gateway.validation.matchConditions` on the Gloo webhook | ||
- `gateway.validation.kubeCoreMatchConditions` on the Kube webhook | ||
Note that match labels are supported from Kubernetes v1.30+ but need to be enabled in Kubernetes v1.27 to v1.30 via the AdmissionWebhookMatchConditions feature gate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...tures/validation/testdata/split-webhook/gloo-webhook-failure-policy-match-conditions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
gateway: | ||
validation: | ||
failurePolicy: Fail # For "strict" validation mode, fail the validation if webhook server is not available | ||
matchConditions: | ||
- name: skip-upstreams | ||
expression: '!(request.resource.group == "gloo.solo.io" && request.resource.resource == "upstreams")' # Match non-upstream resources. | ||
webhook: | ||
skipDeleteValidationResources: [] |
8 changes: 8 additions & 0 deletions
8
...tures/validation/testdata/split-webhook/kube-webhook-failure-policy-match-conditions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
gateway: | ||
validation: | ||
kubeCoreFailurePolicy: Fail # For "strict" validation mode, fail the validation if webhook server is not available | ||
kubeCoreMatchConditions: | ||
- name: skip-secrets | ||
expression: '!(request.resource.group == "" && request.resource.resource == "secrets")' # Match non-secret resources. | ||
webhook: | ||
skipDeleteValidationResources: [] |
Oops, something went wrong.