Initial implementation of AdmissionWebhooks for workspace controller was implemented in way, where an administrator generates TLS certs during deploy, but it has cons:
Instead, we must make workspace controller generating TLS certs for its webhook server.
So, on each start, it will be able to check TLS certs and generate them if they are missing[1] or regenerate if they are expired[2].
The second part can be moved to scope of a separate issue if it will be clear that it requires quite a lot of time... It makes sense to deliver [1] part where certificates have like a couple of mouths expiration time and deliver [2] later.
Some non-working POC is already implemented in https://github.com/che-incubator/che-workspace-operator/pull/24
P.S. It would be also cool to investigate if we're able to reuse default cluster CA (probably we won't be able to get CA private part, but it's needed to analyze it)
Interesting option to go, not sure that it's the right one - since we then would depend on cert manager operator https://github.com/sleshchenko/che-workspace-operator/commit/15f3940e3a84d11a5cab03eb6b76472842f886a0
After doing some research I think there's only 3 ways we can go about this:
To me I think we can remove 1 was a viable option because the package it relies on is not supported anymore, just early stage experiment. However, I've borrowed some of the ideas and put them into 3.
Pros of 2.
Cons of 2.
Pros of 3
Cons of 3.
@sleshchenko @amisevsk WDYT?
I think it's a bit of a toss-up between 2 and 3. Some thoughts:
I think for now, especially since the work is mostly done, option 3 is the way to go. We can discuss more complicated solutions later, while option 3 allows us to keep working on the numerous actual issues we have already.
I'm quite concerned that with option 3 the operator is not self-contained anymore, which might make the installation of the operator through OLM impossible.
The useful links David shared about OLM + Webhook Server:
Support validating admission webhooks https://github.com/operator-framework/operator-sdk/issues/1217
Design proposal Add support for admission webhooks in OLM
https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/contributors/design-proposals/webhooks.md
Most helpful comment
I'm quite concerned that with option 3 the operator is not self-contained anymore, which might make the installation of the operator through OLM impossible.