The kube-webhook-wrapper
is a wrapper you can use with your
kubebuilder
generated project. It is able to register webhooks
automatically in an existing Kubernetes cluster.
Ideally, this project will be used along with a k3d
or kind
environment, so you can run your controller in the host, while
webhooks are registered against the containerized Kubernetes cluster
in an automatic fashion, for development only. In this mode, the
wrapper will take care of:
- Generate a certificate authority and server certificate
- Register the webhook endpoint in the local HTTP server exposed by Kubeuilder (this is done by Kubebuilder by default as well)
- Register webhooks in the API server, so
AdmissionRequests
will flow from the containerized API server to the controller running in the host (using the definedHost
andPort
inctrl.Options
).
The development mode is opt-in, and if it's not enabled explicitly,
the behavior of kube-webhook-wrapper
will be the same as the
original code generated by kubebuilder
.