fix(controller): reduce memory by filtering ReplicaSet informer#4666
fix(controller): reduce memory by filtering ReplicaSet informer#4666blkperl wants to merge 2 commits intoargoproj:masterfrom
Conversation
…llout-managed only. Fixes argoproj#2552 Use a separate replicaSetInformerFactory with WithTweakListOptions to limit the ReplicaSet informer cache to only ReplicaSets that have the rollouts-pod-template-hash label (i.e. those owned by Rollouts). This avoids caching ReplicaSets from Deployments and other controllers, significantly reducing memory usage on clusters with large numbers of ReplicaSets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: William Van Hevelingen <william.vanhevelingen@acquia.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4666 +/- ##
==========================================
+ Coverage 84.86% 84.94% +0.07%
==========================================
Files 164 164
Lines 18954 18965 +11
==========================================
+ Hits 16086 16109 +23
+ Misses 2007 2001 -6
+ Partials 861 855 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Published E2E Test Results 4 files 4 suites 3h 33m 58s ⏱️ For more details on these failures, see this check. Results for commit 36bc32d. ♻️ This comment has been updated with latest results. |
Published Unit Test Results2 443 tests 2 443 ✅ 3m 18s ⏱️ Results for commit 36bc32d. ♻️ This comment has been updated with latest results. |
Signed-off-by: William Van Hevelingen <william.vanhevelingen@acquia.com>
|
|
I really like this PR, do you have any personal graphs or anythign that can show the savings a bit. It seems logical I am just curious if/what you have seen? |



Fixes #2552
Use a separate replicaSetInformerFactory with WithTweakListOptions to limit the ReplicaSet informer cache to only ReplicaSets that have the rollouts-pod-template-hash label (i.e. those owned by Rollouts).
This avoids caching ReplicaSets from Deployments and other controllers, significantly reducing memory usage on clusters with large numbers of ReplicaSets.
Checklist:
"fix(controller): Updates such and such. Fixes #1234".