Skip to content

Expose dependent configuration for the case where we have several dependents of the same type #857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
metacosm opened this issue Jan 21, 2022 · 9 comments · Fixed by #1479 or #1378

Comments

@metacosm
Copy link
Collaborator

How do dependents work when we have more than one secondary resource (like having 3 deployments) ?

Originally posted by @sebastienblanc in #785 (comment)

@scrocquesel
Copy link
Contributor

Thinking about this, I see two kinds of multiple dependents of same type:

  • fixed : the number of dependents is know at build time and a discriminating name should be enough. Dependents may be optional if the spec do not require it.
  • dynamic : the number of dependents is known at reconcile time and depends on the spec of the CR. This is often the case when a CR is a group. After having done such an operator, I do not think it is a good practice. The only pros is that it reduces the number of CRs. Having a lot of CRs and using PerResourcePolling with a low POLL_PERIOD could take down an external system.

@metacosm
Copy link
Collaborator Author

Yes, I tend to think that we should limit ourselves to the fixed case as a start and see how it goes and if we need to make it more dynamic.

@andreaTP
Copy link
Collaborator

andreaTP commented Oct 4, 2022

@csviri can you please point out the documentation or example code to see how this is working? Thanks a lot in advance!

@csviri
Copy link
Collaborator

csviri commented Oct 4, 2022

@csviri can you please point out the documentation or example code to see how this is working? Thanks a lot in advance!

@andreaTP pls take a look here:
https://github.com/java-operator-sdk/java-operator-sdk/blob/9c1be9d59151f1673b5b2a5bea60543021fabd34/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/multiplemanageddependentsametype/MultipleManagedDependentResourceConfigMap1.java#L15-L15

Note that this is on next branch, and the api is going to change probably a little.

@andreaTP
Copy link
Collaborator

andreaTP commented Oct 4, 2022

Thanks for the pointer @csviri , does it make sense to provide "default" discriminators based on something pretty standard like labels?

@csviri
Copy link
Collaborator

csviri commented Oct 4, 2022

usually I think that would be based on rather some naming convention of the resource. So not sure. Might be if we seem some patterns.

@bachmanity1
Copy link
Contributor

@csviri is this feature available now? If yes, could you please share some example code? (sorry, but example you've shared above is not very clear)

@csviri
Copy link
Collaborator

csviri commented Oct 24, 2022

@bachmanity1 no, it will come with 4.1 (see milestone). It will be documented for that release too.

@bachmanity1
Copy link
Contributor

@bachmanity1 no, it will come with 4.1 (see milestone). It will be documented for that release too.

ok, got it. Thanks for quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment