Filter watches on generic resources that we watch by label [performance]
This should significantly affect cluster performance in production.
-
@kosamara started a discussion: (+1 comment) @rvineetr all these
owns
clauses trigger reconciliations for the resource's owner, even if that isn't us:Watches(&source.Kind{Type: <ForType-forInput>}, &handler.EnqueueRequestForOwner{OwnerType: apiType, IsController: true})
(ref). I think we need to play with predicates and filter on a label, so that we don't produce that many unnecessary reconciliations. Imagine how many Svc/Jobs/etc that we don't own might be running on the cluster ;)Feel free to follow this up on another MR by making a follow-up issue.