Skip to content

Commit 7f3868a

Browse files
optional and configurable list of matchConditions (#27)
1 parent 751de75 commit 7f3868a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

chart/templates/webhook.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,7 @@ webhooks:
131131
timeoutSeconds: 10
132132
failurePolicy: Fail
133133
reinvocationPolicy: Never
134+
{{- with .Values.webhook.matchConditions }}
135+
matchConditions:
136+
{{- toYaml . | nindent 2 }}
137+
{{- end }}

chart/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ pdb:
6262
maxUnavailable: ""
6363

6464
webhook:
65+
# -- Match conditions for webhooks can be used for fine-grained request filtering. Docs: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchconditions
66+
matchConditions: []
67+
# -- Examples from documentation:
68+
# -- - name: 'exclude-leases' # Each match condition must have a unique name
69+
# -- expression: '!(request.resource.group == "coordination.k8s.io" && request.resource.resource == "leases")' # Match non-lease resources.
70+
# -- - name: 'exclude-kubelet-requests'
71+
# -- expression: '!("system:nodes" in request.userInfo.groups)' # Match requests made by non-node users.
72+
# -- - name: 'rbac' # Skip RBAC requests, which are handled by the second webhook.
73+
# -- expression: 'request.resource.group != "rbac.authorization.k8s.io"'
6574
certManager:
6675
# -- Whether to use cert-manager to manage webhook tls
6776
enabled: false

0 commit comments

Comments
 (0)