Skip to content

Add FeatureFlag CacheFluxcdObjects#1265

Draft
adri1197 wants to merge 1 commit intofluxcd:mainfrom
adri1197:informer-cache
Draft

Add FeatureFlag CacheFluxcdObjects#1265
adri1197 wants to merge 1 commit intofluxcd:mainfrom
adri1197:informer-cache

Conversation

@adri1197
Copy link
Contributor

@adri1197 adri1197 commented Mar 6, 2026

Introduce an opt-in CacheFluxObjects feature flag that enables caching of FluxCD objects (GitRepository, Kustomization, HelmRelease, etc.) via Kubernetes informers. Currently, the notification-controller makes direct API calls to fetch FluxCD objects when matching Alert event sources with label selectors. In clusters with many Alerts and FluxCD resources, this creates performance bottlenecks and increases API server load. By enabling this feature flag, FluxCD objects are cached in memory through informers, making reads significantly faster and reducing API server pressure. The implementation conditionally registers FluxCD controller schemes before manager creation, allowing controller-runtime to automatically create informers for these types. When disabled (default), the current behavior is maintained with no additional memory or RBAC requirements. When enabled, users gain improved performance at the cost of increased memory usage and additional RBAC permissions (list/watch on FluxCD resources). Enable with --feature-gates=CacheFluxObjects=true.

Signed-off-by: Adrian Fernandez de la Torre <adri1197@gmail.com>
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