helm-operator: reduce cache memory footprint#6377
helm-operator: reduce cache memory footprint#6377joelanford merged 1 commit intooperator-framework:masterfrom
Conversation
eec96ff to
3611b3b
Compare
3611b3b to
7ab70c8
Compare
0d1ab36 to
c6eca8f
Compare
c6eca8f to
fd49b96
Compare
fd49b96 to
ce8c010
Compare
| defaultSelector := labels.NewSelector().Add(*req) | ||
|
|
||
| return cache.BuilderWithOptions(cache.Options{ | ||
| SelectorsByObject: selectorsByObject, |
There was a problem hiding this comment.
Just to understand this right, we cache objects based on labels from all the charts in watches.yaml only when - a single namespace, or all namespaces are watched. When multiple namespaces are watched, this gets overridden here (
Seems like it shouldn't be the case, and if we are adding a label selector for caching then single or multiple namespaces shouldn't matter. Or am I missing something?
There was a problem hiding this comment.
Oh good catch. I totally missed that. We might need to bump the controller-runtime dependency to get the new and improved cache options to handle that case.
There was a problem hiding this comment.
I'm not sure on how urgent it is to have this in. We can either track this through an issue and make sure we get this fixed as a follow up after the bump or block the PR on #6514
There was a problem hiding this comment.
I think I managed to account for multiple namespaces without having to bump controller-runtime. PTAL!
Make use of label selectors used by informers for both the primary CR and for chart manifest objects Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
Description of the change:
This PR updates the Helm operator to use a custom cache function so that we can:
Motivation for the change:
This should be a significant improvement in the memory usage of helm-operator, especially on clusters with a large number of objects.
Closes #6255
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments(seechangelog/fragments/00-template.yaml)website/content/en/docs