Open davidfestal opened 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
We probably want careful guidrails on this sort of thing to help users not DoS themselves in a sharded/multi-region kcp
.
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.
/transfer-issue contrib-tmc
/transfer-issue contrib-tmc
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:
tunneler.GetDialer
function)NewSingleHostReverseProxy
) to the tunneler lister