Matt,
We've seen cases where dependent items cause events to continue coming in. Recently a
PR [1] was merged to help identify situations like yours where we can see what is
causing the changes.
Also, there was a PR [2] that fixed an issue with the predicate to ignore managed
fields.
[1]
https://github.com/operator-framework/operator-sdk/pull/4779
[2]
https://github.com/operator-framework/operator-lib/pull/59
These might help identify why the Ansible operator is using high cpu.
Sincerely,
jesus
--
jesus m. rodriguez |
jes...@redhat.com
principal software engineer | irc: zeus
red hat operator sdk |
919.754.4413 (w)
rhce # 805008586930012 |
919.623.0080 (c)
+---------------------------------------------+
| "Those who cannot remember the past |
| are condemned to repeat it." |
| -- George Santayana |
+---------------------------------------------+
On Wed, 2021-05-05 at 15:56 +0100, Camila Macedo wrote:
> Hi Matt,
>
> Could you please share the watches.yaml file as well for we have a better
> idea over the configuration made? Also, could you let us know if you are
> using the option `reconcilePeriod `?
>
> Cheers,
>
> CAMILA MACEDO
>
> SR. SOFTWARE ENGINEER
>
> RED HAT Operator framework
>
> Red Hat UK <
https://www.redhat.com/>
>
> She / Her / Hers
>
> IM: cmacedo
> <
https://red.ht/sig>
>
>
>
>
> On Wed, May 5, 2021 at 2:48 PM Daniel Messer <
dme...@redhat.com> wrote:
>
> > Maybe I read this incorrectly but it seems what Matt is seeing is that,
> > with a watch on Pods, there are a lot of events generated by Kubernetes
> > about those Pods, even when they are not changing in state ("idling"). So
> > it's not about watching too much but "being called too often", even though
> > nothing changed. Is that what you mean?
> >
> > On Wed, May 5, 2021 at 1:09 PM Camila Macedo <
cma...@redhat.com> wrote:
> >
> > > Hi Matt,
> > >
> > > When an operator watches many resources, each reconcile can become
> > > expensive, and a low value in the reconcile period for example can actually
> > > reduce performance. Usually, you will watch the resources that your project
> > > own and trigger the reconcile when some event is raised such as the
> > > resource is updated, deleted, edited and or created.
> > >
> > > So, I'd like to suggest you check out the following documents to
> > > understand the watch feature and its options to see how you better
> > > can address your needs.
> > >
> > > - *Ansible Operator Watches:*
> > >
> > >
https://sdk.operatorframework.io/docs/building-operators/ansible/reference/watches/
> > > - *Dependent Watches*:
> > >
> > >
https://sdk.operatorframework.io/docs/building-operators/ansible/reference/dependent-watches/
> > >
> > > After that, if you still requiring help with we will need to have a
> > > further context about your scenario and requirements such as to know
> > > what/why/when you need to reconcile. Maybe raise an issue in the repo and
> > > answer fully the template questions can be helpful in this case.
> > >
> > > I hope that it helps you out.
> > >
> > > Cheers,
> > >
> > > CAMILA MACEDO
> > >
> > > SR. SOFTWARE ENGINEER
> > >
> > > RED HAT Operator framework
> > >
> > > Red Hat UK <
https://www.redhat.com/>
> > >
> > > She / Her / Hers
> > >
> > > IM: cmacedo
> > >
> > > <
https://red.ht/sig>
> > > > *CONFIDENTIALITY NOTICE: This email may contain confidential and
> > > > privileged material for the sole use of the intended recipient(s). Any
> > > > review, use, distribution or disclosure by others is strictly prohibited.
> > > > If you have received this communication in error, please notify the sender
> > > > immediately by e-mail and delete the message and any file attachments from
> > > > your computer. Thank you.*
> > > > <
https://groups.google.com/d/msgid/operator-framework/d4214a97-812e-48b4-8c55-9e1b99542d1en%40googlegroups.com?utm_medium=email&utm_source=footer
> > > > >
> > > > .
> > > >
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Operator Framework" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an
> > > email to
operator-framew...@googlegroups.com.
> > > To view this discussion on the web visit
> > >
https://groups.google.com/d/msgid/operator-framework/CACQ0tdCwSVQYYEDEoSqNZ-nGbeouF9EYKFg-3UirQAp1-rQZ6Q%40mail.gmail.com
> > > <
https://groups.google.com/d/msgid/operator-framework/CACQ0tdCwSVQYYEDEoSqNZ-nGbeouF9EYKFg-3UirQAp1-rQZ6Q%40mail.gmail.com?utm_medium=email&utm_source=footer
> > > >
> > > .