Replies: 1 comment 5 replies
-
My initial thinking would be to use workflows with the same reconcile pre-condition for all the related dependents so that their reconciliation would only be triggered at once. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there!
I'm wondering what could be the best implementation for the reconciliation of "groups of dependent resources".
Typically, I have a CRD with different blocks representing different application modules. Each block may be enabled/disabled and if enabled will typically lead to the management of many Kubernetes resources (let's say a
Deployment
, aService
, aConfigMap
, and aService
- all of them to be reconciled together)I was first thinking of a
BulkDependentResource
implementation, but it seems like it's only for the same kind of resources. I'd prefer handling a reconciliation grouping approach based on the application modules rather than on technical resources.So at the moment, I think about implementing a dedicated
ModuleXDependentResource
for each module and having:Thus I have to define an associated
ModuleXResources
class that would act as my secondary resources handler (basic Kube objects) that must be reconciled together. From what I've seen so far, this would imply getting some work on thepublic Optional<R> getSecondaryResource(P primary, Context<P> context)
method implementation.Would you say it's the better/recommended way of doing things?
I've also considered some other options:
Reconcilers
for the same CR as I have different application modules/blocks in the CRD. However I'm afraid, this breaks the principle of "One controller/operator per CRD" and led to race conditions/sync issues when it comes to updating the CRStatus
,Workflows
but it looks like I have no real dependency between the reconciliation logic of the different modules. The workflow approach looks then a bit overkill for this.Thanks for reading! Any suggestion is greatly appreciated! 😉
Beta Was this translation helpful? Give feedback.
All reactions