feat: Cache transform for Secrets and ConfigMaps to reduce memory#1866
Merged
svghadi merged 16 commits intoargoproj-labs:masterfrom Nov 4, 2025
Merged
feat: Cache transform for Secrets and ConfigMaps to reduce memory#1866svghadi merged 16 commits intoargoproj-labs:masterfrom
svghadi merged 16 commits intoargoproj-labs:masterfrom
Conversation
4 tasks
anandf
reviewed
Sep 23, 2025
anandf
reviewed
Sep 23, 2025
anandf
reviewed
Sep 23, 2025
svghadi
commented
Oct 23, 2025
svghadi
commented
Nov 3, 2025
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
anandf
reviewed
Nov 3, 2025
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
mikeshng
pushed a commit
to mikeshng/argocd-operator
that referenced
this pull request
Nov 4, 2025
…goproj-labs#1866) * WIP Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Code clenup and commenting Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Add proposal doc Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * merge transform func, add tests for configmap and secret Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * add env var to disable optimization, update docs Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * fix CI lint failure Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * incorporate PR review Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * update IsTrackedByOperator func to take in runtime.Object Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> * Fix minor issues Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Minor code comment updates Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Add unit test for client Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Fix linting Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Use positive notion for env Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Remove space and return patch error to caller Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Add unit test for patch error Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Move trackedby check out of referesh check func Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Co-authored-by: Anand Kumar Singh <anandrkskd@gmail.com> Signed-off-by: Mike Ng <ming@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind enhancement
What does this PR do / why we need it:
This PR reduces memory usage in the Argo CD Operator by introducing a cache transform and client wrapper for Secrets and ConfigMaps.
See the attached proposal in this PR for design details, trade-offs, PoC results, and future scope.
Results
These metrics were collected from a test cluster containing 100 ConfigMaps and 100 Secrets, each approximately 1 MB in size. The cluster was running four Argo CD instances and no other workload operators.
With the optimization enabled, operator memory usage dropped from ~350 MB to ~100 MB.
UnOptimized Operator Manager Memory:
Optimized Operator Manager Memory:
However, we could not reduce the startup memory consumption, which remained at ~750 MB in both cases.
We previously attempted another approach in #1795, but it introduced significant complexity and restricted how watches could be set up. Compared to that, this solution provides a better balance between complexity, maintenance overhead, and outcome.