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

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

Conversation

mjshastha
Copy link

@mjshastha mjshastha commented Oct 29, 2024

  • Updated cache.Options with a DefaultTransform function that removes managed fields and the "kubectl.kubernetes.io/last-applied-configuration" annotation from objects before storing them in the cache.
  • Stripping managed fields reduces cache memory overhead, which improves performance in large clusters. ref: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/cache#TransformStripManagedFields
  • Removing the "last-applied-configuration" annotation prevents unnecessary cache bloat.

This enhancement minimizes cache size and resource usage, improving controller runtime performance and memory management.

…oves managed fields and the `"kubectl.kubernetes.io/last-applied-configuration"` annotation from objects before storing them in the cache.

- Stripping managed fields reduces cache memory overhead, which improves performance in large clusters.
- Removing the `"last-applied-configuration"` annotation prevents unnecessary cache bloat and reduces redundant reconciliation triggers caused by changes to this field, which does not require for operation.

This enhancement minimizes cache size and resource usage, improving controller runtime performance and memory management.
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