cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
243 stars 65 forks source link

Split Bundle controller into multiple controllers #245

Open erikgb opened 9 months ago

erikgb commented 9 months ago

We currently have a single controller in trust-manager, and this controller has a lot of responsibilities. I can identify at least the following:

Since we always reconcile bundles, this creates a long and quite complex reconcile process. I have been looking a implementing https://github.com/cert-manager/trust-manager/issues/58, and that would a least require a new controller. Introducing a new controller is doable, but we would need a lot of the logic from the existing bundle controller. And waste compute resources by building everything from scratch.

I would suggest splitting the single existing controller into:

This might seem complex, and I am happy to discuss adjustments. 😃 I think the first controller is the most important, as it will ensure we process bundle sources once per bundle.

I see the following benefits from this refactoring:

A potential downside/challenge, is maintaining the Bundle Synced condition. But do we really need it? What about heading for the kstatus approach, where the idea is to add conditions when something is wrong.

CC @inteon @SgtCoDFish

arsenalzp commented 8 months ago

Hello, If you need help with this bunch of tasks, I kindly help you with that!

erikgb commented 8 months ago

If you need help with this bunch of tasks, I kindly help you with that!

Thanks @arsenalzp, but we have discussed this a bit and decided to put it a bit on hold. It will increase the complexity of our controller machinery. So not sure if we ever want to do this.