Repository navigation
Add global cluster-aware validating admission webhook - #4288
Conversation
Introduce a compiled-in admission plugin, apis.kcp.io/GlobalValidatingWebhook, that applies a single ValidatingWebhookConfiguration - supplied to the shard at startup via --admission-control-config-file - to requests in EVERY logical cluster, without a per-workspace WebhookConfiguration object. This is to admission what --authorization-webhook-config-file is to authorization: one endpoint, wired at bootstrap, applied globally. Unlike the authorization webhook it is an admission webhook, so the callout carries the full object body + operation and can deny. The request's logical cluster is conveyed to the endpoint on the object's kcp.io/cluster annotation (create/update on the object, delete on the old object). Parsed config is run through API defaulting so nil namespace/object selectors do not silently match nothing. - pkg/admission/globalwebhook: the plugin (static webhook source) + unit tests - pkg/admission/plugins.go: register, order, default-on (inert unless configured) - pkg/server/options/flags.go: expose --admission-control-config-file - config/examples/global-admission-webhook: example admission config + README - test/e2e/admissionwebhook: dedicated-server e2e proving global reach, cluster-awareness and deny on a native ConfigMap across two workspaces
0607ee2 to
db447a8
Compare
neolit123
left a comment
There was a problem hiding this comment.
LGTM, this is great!
likely worth mentioning the new flag in the release note?
|
Release note updated to mention the exposed |
|
Added a big code comment explaining why the path is not there, so when (it's a question of time) we get the request we remember :D |
|
/retest |
|
LGTM label has been added. DetailsGit tree hash: 7cd4ca46d22b363cd3664cac208fd40403ce4ff0 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ntnn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/retest |
Summary
Introduce a compiled-in admission plugin,
apis.kcp.io/GlobalValidatingWebhook, that applies a singleValidatingWebhookConfiguration- supplied to the shard at startup via--admission-control-config-file- to requests in EVERY logical cluster, without a per-workspace WebhookConfiguration object.This is to admission what
--authorization-webhook-config-fileis to authorization: one endpoint, wired at bootstrap, applied globally. Unlike the authorization webhook it is an admission webhook, so the callout carries the full object body + operation and can deny. The request's logical cluster is conveyed to the endpoint on the object'skcp.io/clusterannotation (create/updateon the object, delete on the old object). Parsed config is run through API defaulting so nil namespace/object selectors do not silently match nothing.This allows to start setting global policies on all instance.
What Type of PR Is This?
/kind feature
Related Issue(s)
Fixes #
Release Notes