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

Disable caching of secrets and configmaps #989

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

mac-chaffee
Copy link
Contributor

@mac-chaffee mac-chaffee commented Dec 17, 2022

For background, see fluxcd/helm-controller#512 and fluxcd/helm-controller#513

This PR adds a new opt-in feature gate (CacheSecrets) which causes the default source controller to stop caching secrets. Users can set that feature gate to "true" to go back to the old behavior of caching secrets.

The source controller fetches secrets to perform authenticated git clones, but the controller-runtime client greedily fetches all secrets in the cluster to cache them (LIST and WATCH operations instead of GET operations). Since it's common to have very large secrets for helm charts, this behavior can use up a lot of RAM.

I'm also interested in this feature so that users can run source-controller without giving it cluster-wide access to secrets which can be quite a dangerous permission.

@souleb souleb added enhancement New feature or request experimental Issues and pull requests related to experimental features labels Dec 19, 2022
docs/spec/README.md Outdated Show resolved Hide resolved
internal/features/features.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
internal/features/features.go Outdated Show resolved Hide resolved
internal/features/features.go Outdated Show resolved Hide resolved
@mac-chaffee mac-chaffee force-pushed the no-cache-secrets branch 2 times, most recently from 9094965 to a20c11b Compare January 18, 2023 15:39
@mac-chaffee mac-chaffee requested review from hiddeco and darkowlzz and removed request for hiddeco and darkowlzz January 18, 2023 15:40
You can re-enable caching by starting the controller
with the argument '--feature-gates=CacheSecretsAndConfigMaps=true'

Signed-off-by: Mac Chaffee <[email protected]>
@stefanprodan stefanprodan removed the experimental Issues and pull requests related to experimental features label Jan 27, 2023
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mac-chaffee 🙇

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

Successfully merging this pull request may close these issues.

5 participants