-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhooks intercepting exclude specific resources #3038
Comments
Thanks for raising this @Markieta. Does configure your own validating webhook: https://github.com/open-policy-agent/gatekeeper/blob/master/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml#L49 Note: matchConditions (FEATURE STATE: Kubernetes v1.28 [beta]) is still beta in 1.28, most people are either not on 1.28 yet or they might not have this feature enabled for their cluster yet. |
It would be a bit tedious to explicitly state each resource type to intercept, but I agree it is probably the most feasible approach for now. Thanks for your input! |
@ritazh @Markieta what about adding {{- if ge (int .Capabilities.KubeVersion.Minor) 28 }}
matchConditions: {{ toYaml .Values.validatingWebhookMatchConditions | nindent 4 }}
{{- end }} if it is fine for you @ritazh , I would prepare another PR to contribute to this enhancement 😄 |
I think that’s reasonable and valuable. WDYT @sozercan @maxsmythe ? |
SGTM, though we probably want to put the match conditions on their own line, and support multiple entries. |
@maxsmythe yes. just like the value of |
Do we want to allow for separate exclusions for mutation vs. validation? |
@maxsmythe I would recommend & advocate using separate ones to align with the way how it is implemented for PR is in place 👍 |
GKE clusters warn about
Intercepting cluster-scoped system resources
.Google recommends excluding
nodes
,tokenreviews
,subjectaccessreviews
, andcertificatesigningrequests
on webhooks intercepting those as they consider it unsafe.I believe
matchConditions
(FEATURE STATE: Kubernetes v1.28 [beta]) can be used here to exclude those cluster-scoped (or any other) resources ongatekeeper-validating-webhook-configuration
&gatekeeper-mutating-webhook-configuration
.The text was updated successfully, but these errors were encountered: