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

Reduce operator memory usage by using an informer with limited scope #2552

Open
blkperl opened this issue Jan 31, 2023 · 2 comments
Open

Reduce operator memory usage by using an informer with limited scope #2552

blkperl opened this issue Jan 31, 2023 · 2 comments
Labels
enhancement New feature or request no-issue-activity

Comments

@blkperl
Copy link
Contributor

blkperl commented Jan 31, 2023

Summary

In #2545, @zachaller suggested the following could be used to lower memory usage.

kubeInformerFactory := kubeinformers.NewSharedInformerFactoryWithOptions(
				kubeClient,
				resyncDuration,
				kubeinformers.WithNamespace(namespace), kubeinformers.WithTweakListOptions(func(options *metav1.ListOptions) {
					options.LabelSelector = "rollouts-managed=managed-key"
				}))

The key being WithTweakListOptions, and we would also probably need to add some managed by label to the rs. We might even be able to just use a LabelSelector="rollouts-pod-template-hash" meaning just to have the key and match any value

This has been done in other operators using the NewCache pattern:

The following links have documentation on how use the cache selectors.

Use Cases

This would reduce memory usage on clusters with large amounts of replicasets.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@blkperl blkperl added the enhancement New feature or request label Jan 31, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2023

This issue is stale because it has been open 60 days with no activity.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

This issue is stale because it has been open 60 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants