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

perf: Optimize cache by minimizing unnecessary data storage. #1405

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mjshastha
Copy link
Collaborator

@mjshastha mjshastha commented Nov 6, 2024

Updates to controller-runtime and client-go for better performance, bug fixes, and memory optimization.

Stripped managed fields and last-applied-configuration from resources and cache:

  • Implemented object metadata transformation using WithTransform in NewSharedInformerFactoryWithOptions for shared informers. ref: informers package - k8s.io/client-go/informers - Go Packages
  • Updated the controller runtime manager cache to include DefaultTransform, leveraging TransformStripManagedFields() along with logic to remove the last-applied-configuration annotation for all cached objects. ref: cache package - sigs.k8s.io/controller-runtime/pkg/cache - Go Packages
  • These changes ensure that unwanted metadata is removed from objects before they are stored in the cache, optimizing memory usage and improving performance.

Additionally, fixed failing unit test cases.

@mjshastha mjshastha force-pushed the SBOptmizations branch 4 times, most recently from 0b948cd to 999f3b5 Compare November 7, 2024 03:07
…ug fixes, and memory optimization.

Stripped managed fields and last-applied-configuration from resources and cache:

Implemented object metadata transformation using `WithTransform` in `NewSharedInformerFactoryWithOptions` for shared informers. ref: informers package - k8s.io/client-go/informers - Go Packages

Updated the controller runtime manager cache to include `DefaultTransform`, leveraging `TransformStripManagedFields()` along with logic to remove the last-applied-configuration annotation for all cached objects. ref: cache package - sigs.k8s.io/controller-runtime/pkg/cache - Go Packages

These changes ensure that unwanted metadata is removed from objects before they are stored in the cache, optimizing memory usage and improving performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant