Replies: 1 comment 1 reply
-
|
@stefanprodan ; any thoughts on this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Flux CLI and Kustomize Controller currently default to generating a
kustomization.yamlfile in the Kustomization target paths, if no existing file is found. It also does so while recursively walking any directories that also match this condition.This is documented, albeit briefly:
kustomize, not entirely accurate)I'd like to suggest introducing a feature flag to the Kustomize Controller to allow opting out of this behaviour. e.g.,
DisableMissingKustomizationGeneration. We'd also need to add a corresponding flag to the CLI.This automatic generation feature, while convenient, does bring with it a couple concerns;
kustomize buildorkubectl ... -kbehavior (which is to fail). This naturally isn't the only difference (notably, enablingLoadRestrictionsNodeby default), but is non-obvious. The equivalent behavior is only available inkustomize create, notkustomize build.kustomization.yamlfile in there; however this requires (end-user) understanding of the exact "GitOps solution".kustomization.yamlfile, where one was previously generated.For a bit of context on motivation; I'm running Flux in an environment with a majority of users who only occasionally interact with our FluxCD repositories (e.g., configuring applications, adding a new deployment, minor tweaks, etc). In-depth and "fresh" knowledge of Flux's behavior is therefore quite limited and lives with a few individuals. Knowledge management and automation/validation solutions help a lot, but I myself unintentionally added a
kustomization.yamlfile to our cluster directory... with disastrous results. Our Flux proficiency has since grown a fair bit ;-)In terms of implementation, we're already tracking whether the
kustomization.yamlfiles are being generated (seeCreatedActionthroughout https://github.com/fluxcd/pkg/blob/main/kustomize/kustomize_generator.go#L67), and feature flags & other details of how Kustomizations are resolved are already configurable. This would a relatively small implementation in code and be very testable behavior.I'd be happy to look at implementing this, if it's something that would be agreed to :-)
Beta Was this translation helpful? Give feedback.
All reactions