-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Best practice of dynamic ConcurrentReconciles #1966
Comments
@HamzaZo: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Regard your question see that It is not possible to have two reconcile loops that handle the same object at the same time.
By default, the MaxConcurrentReconciles will be 1 so you need to set another value if you are looking for that in the manager when the project is initialized. It is not a k8s doc, however, might help you: http://openkruise.io/en-us/blog/blog2.html NOTE It is not about your specific question, however, I'd like to share that regards the best practices over the controllers/reconciliation in general I'd say the main one would be to develop idempotent solutions. The idea is that when you reconcile a resource of our API(crd/cr) you are looking to do a collection of operations until it has the desired state on the cluster. I want to suggest you check doc Groups and Versions and Kinds, oh my! to understand better what APIs means and be able to design better solutions. Also, see that it’s recommended to have one controller responsible for manage each API created for the project to properly follow the design goals set by controller-runtime. I raised an issue in the controller runtime to improve the docs with an official explanation. kubernetes-sigs/controller-runtime#1416. And then, would be nice to get your help with. Please, feel free to follow up it there. I am closing this one as sorted out since we addressing it in controller-runtime as well. However, if you still with doubts feel free to raise new issues. |
My controller watches for created CR and starts to reconcile, in the reconcile loop I do some business logic using Terraform. If I create two CR at the same time :
Afterwards, I noticed that the default value of concurrent reconciles is
worker.count=1
, so I modifySetupWithManager
as follows:But I'm wondering, what is the best practice for dynamic concurrent reconciles? and how to let my controller handles differents request at the same time without hardcoding the value of
MaxConcurrentReconciles
? Also, If I create more than one replicas how to handle this ?Any help is appreciated?
Thanks
/triage support
The text was updated successfully, but these errors were encountered: