kcp-dev / contrib-tmc

An experimental add-on readding some Kubernetes compute APIs and impement transparent multi-cluster scheduling
Apache License 2.0
5 stars 3 forks source link

Support Admission WebHooks that use Services #37

Open davidfestal opened 1 year ago

davidfestal commented 1 year ago

The need

A quite big proportion of controllers that create Kubernetes standard workload objects (Deployments, ...) from higher-level or domain-specific CRDs define webhooks. And in most cases these are service-based webhooks. These should be supported in a typical TMC environment if we want such operators to be usable, or at least testable under TMC.

First POC

A branch already already provides a hacky and non-mergeable implementation of service-based webhooks: https://github.com/kcp-dev/kcp/pull/2910, which directs the webhooks to services/proxy sub-resources (themselves tunneled to the SyncTarget physical cluster.

While this works feature-wise and allows playing with controllers that require webhooks, this is a no-go and cannot be merged, since insecure: services/proxy uses insecure TLS connections, so that the CAs of the webhook configurations are ignored.

Required changes for a real implementation

A real implementation would require tunneling such requests at the TCP level, and not at the http level. According to the first exploration, this probably involves the following changes:

davidfestal commented 1 year ago

Changes required for a real implementation started in the following branch: https://github.com/kcp-dev/kcp/compare/main...davidfestal:service-based-webhooks-at-tcp-level

stevekuznetsov commented 1 year ago

We probably want careful guidrails on this sort of thing to help users not DoS themselves in a sharded/multi-region kcp.

davidfestal commented 1 year ago

We probably want careful guidrails on this sort of thing to help users not DoS themselves in a sharded/multi-region kcp.

@stevekuznetsov Please provide more details here. help welcomed.

mjudeikis commented 1 year ago

/transfer-issue contrib-tmc

mjudeikis commented 1 year ago

/transfer-issue contrib-tmc