Skip to content
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

Add predicates to Ansible operator for filtering Update, Delete, and Create events #1968

Closed
rammohanc opened this issue Sep 25, 2019 · 5 comments · Fixed by #2024
Closed
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/ansible Issue is related to an Ansible operator project

Comments

@rammohanc
Copy link
Contributor

rammohanc commented Sep 25, 2019

Feature Request

Is your feature request related to a problem? Please describe.
Without predicates for update events, controller is triggering reconcile for objects that have not changed, by user, causing unnecessary reconciles. Adding predicates to the Ansible operator, similar to how Helm operator is handling the update, create and delete events, will help optimize the Ansible operator. We have tried the above changes for update event and it helped reduce the amount of reconciles (or the number of times the playbook is run) significantly as we have many CRs (close to hundred)

Describe the solution you'd like
Predicates should be added before the events are passed to the controller.

@camilamacedo86 camilamacedo86 added language/ansible Issue is related to an Ansible operator project kind/feature Categorizes issue or PR as related to a new feature. labels Sep 25, 2019
@camilamacedo86
Copy link
Contributor

c/c @fabianvf

@shawn-hurley
Copy link
Member

I would really like to understand the reasoning for wanting these direct events.

We have tried to hide this from the user as we don't believe that this information is necessary and causes more edge cases then you would expect. to see a more detailed response look here: kubernetes-sigs/controller-runtime#374 (comment)

I would love to help figure out what/why we need this and how we can enable the functionality you're looking for without exposing the events.

@joelanford
Copy link
Member

@rammohanc Are you talking about this predicate that is used to filter events of dependent resources?

@rammohanc
Copy link
Contributor Author

Hi @shawn-hurley

Reason behind the feature ask is we are seeing the occasional reconciles on CRs, that have not changed or its dependents have not been updated by the user (watchDependentResources and inject_owner_reference are turned on). When we are getting the update event for any of the dependent objects , that have not been updated by the user, reconcile is getting triggered. We want to avoid these reconcile or running playbook when we know there is no change to the dependent object similar to how Helm operator is handling these events. We made the changes and we don't see the above mentioned reconciles.

Thanks

I would really like to understand the reasoning for wanting these direct events.

We have tried to hide this from the user as we don't believe that this information is necessary and causes more edge cases then you would expect. to see a more detailed response look here: kubernetes-sigs/controller-runtime#374 (comment)

I would love to help figure out what/why we need this and how we can enable the functionality you're looking for without exposing the events.

@rammohanc
Copy link
Contributor Author

Hi @joelanford ,

Yes, we have used some of that logic (for update event) to address the reconciles that are not needed.

@rammohanc Are you talking about this predicate that is used to filter events of dependent resources?

rammohanc pushed a commit to rammohanc/operator-sdk that referenced this issue Oct 8, 2019
Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes operator-framework#1968
rammohanc pushed a commit to rammohanc/operator-sdk that referenced this issue Oct 8, 2019
Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes operator-framework#1968
rammohanc pushed a commit to rammohanc/operator-sdk that referenced this issue Oct 22, 2019
Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes operator-framework#1968
rammohanc pushed a commit to rammohanc/operator-sdk that referenced this issue Oct 23, 2019
Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes operator-framework#1968
rammohanc pushed a commit to rammohanc/operator-sdk that referenced this issue Oct 24, 2019
Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes operator-framework#1968
joelanford pushed a commit that referenced this issue Oct 30, 2019
…2024)

Event filtering will allow Ansible operator to skip reconciles that are not required

Fixes #1968
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/ansible Issue is related to an Ansible operator project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants