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. #1406

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

mjshastha
Copy link
Collaborator

Updates to controller-runtime and client-go for better performance, b…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.

Description

Related issues

  • Close #XXX

Remove this section if you don't have related PRs.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

…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.
@deven0t deven0t merged commit 642ef5b into main Dec 11, 2024
7 checks passed
@deven0t deven0t deleted the SBOpt branch December 11, 2024 06:21
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.

2 participants