Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm-operator: reduce cache memory footprint #6377

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Mar 24, 2023

Description of the change:
This PR updates the Helm operator to use a custom cache function so that we can:

  1. Use informer label selectors (rather than a predicate) to watch only the primary CRs that match the selector in the watches.yaml file
  2. Use informer label selectors to watch only the operand objects that are being managed by the operator (rather than ALL objects that have the same kind that the operator happens to be managing)

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:

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 24, 2023
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 01:37 — with GitHub Actions Inactive
@joelanford joelanford force-pushed the helm-operator-cache-selectors branch from eec96ff to 3611b3b Compare March 24, 2023 20:10
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:10 — with GitHub Actions Inactive
@joelanford joelanford force-pushed the helm-operator-cache-selectors branch from 3611b3b to 7ab70c8 Compare March 24, 2023 20:19
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:19 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:20 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy March 24, 2023 20:20 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 00:46 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 00:46 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 00:46 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 00:46 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 00:46 — with GitHub Actions Inactive
@joelanford joelanford force-pushed the helm-operator-cache-selectors branch from c9f0367 to f6af8f7 Compare October 4, 2023 01:21
@joelanford joelanford temporarily deployed to deploy October 4, 2023 01:22 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 01:22 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 01:22 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 01:22 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 01:22 — with GitHub Actions Inactive
@joelanford joelanford force-pushed the helm-operator-cache-selectors branch from f6af8f7 to 63aed85 Compare October 4, 2023 03:09
@joelanford joelanford temporarily deployed to deploy October 4, 2023 03:09 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 03:09 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 03:09 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 03:09 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 03:09 — with GitHub Actions Inactive
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>
@joelanford joelanford force-pushed the helm-operator-cache-selectors branch from 63aed85 to e4b6554 Compare October 4, 2023 14:56
@joelanford joelanford temporarily deployed to deploy October 4, 2023 14:57 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 14:57 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 14:57 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 14:57 — with GitHub Actions Inactive
@joelanford joelanford temporarily deployed to deploy October 4, 2023 14:57 — with GitHub Actions Inactive
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2023
@joelanford joelanford merged commit 16da916 into operator-framework:master Oct 4, 2023
23 checks passed
@joelanford joelanford deleted the helm-operator-cache-selectors branch October 4, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable caching for Helm Operator when watching all namespaces to avoid OOMKilled in big clusters
5 participants