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

IgnoreMissingValueFiles option to prevent passing non-existing valueFiles to helm template #7767

Closed
ocraviotto opened this issue Nov 22, 2021 · 1 comment · Fixed by #8003
Labels
enhancement New feature or request
Milestone

Comments

@ocraviotto
Copy link
Contributor

ocraviotto commented Nov 22, 2021

Summary

This is a proposal to add a new application's source.helm.ignoreMissingValueFiles property so that when set to true, ArgoCD would not pass files in valueFiles to helm template if they don't exist in the source under the specified path.

Motivation

We currently use the app-of-apps pattern with a root Helm app whose application source.helm.valueFiles lists a static values.yaml and a dynamic [cluster-fqdn]-values.yaml file, which currently needs to exist even if empty and is used for overrides only. Needless to say, with each new cluster we end up having an additional override values file (most of which are empty).
The thing is, we also follow the same pattern for applications, and though some configurations live in a central applications folder at our app-of-apps repository (from the root, values are found under applications/[app-name]/values/) others hold that in their own repository (under k8s/values/ - their helm is found under k8s/[service-name]).
This makes it very difficult to default a list of valueFiles following the same pattern for all our services without having to create all of these additional empty files in multiple locations.

I reckon there are ways around this to make the pattern work, but they all seem to require additional configuration or the empty files we're currently using. Inspired by a proposal mentioned by @m-yosefpor at the end of this message (yet having a slightly different idea about its necessity), and realizing I'm not alone in having this question or trying to define a defaults/overrides pattern when using the app-of-apps (see the linked message and the original question it responds to), I thought to bring this up for discussion, as IMHO the best way to enable this default/overrides pattern at scale is to have a config option to purposely ignore missing values files before they're passed to helm (and fail).

Proposal

To be able (declaratively or via cli) to set a new Boolean source.helm property ignoreMissingValueFiles so that, when false (default), we'd have the current behavior (valueFiles passed to helm templateregardless of existence), but when set to true, the reposerver repository helmTemplate processing of valuesFiles would be changed so that, for each values file in valueFiles, it would simply enable checking that, when the reference is a file, that file exists, and when it does not, it would log the omission and prevent appending it to the list of value files options that are passed to the helm template command. This way, configuring potentially non-existing files would not result in a failed helm template command.

Note

I'm willing to submit this change myself, since from a look at the code it seems simple enough, but would appreciate feedback, recommendations, ideas and the like before I do.

@ocraviotto ocraviotto added the enhancement New feature or request label Nov 22, 2021
@Uriende
Copy link

Uriende commented Nov 23, 2021

This is exactly the solution that we would prefer. I originally also thought about giving the code a look but didn't find the time.
This indeed would solve our issue entirely.

ocraviotto added a commit to ocraviotto/argo-cd that referenced this issue Dec 20, 2021
so as to allow operators to prevent Argo CD from passing valueFiles
to helm template if they don't exist in the source under the specified path.

Signed-off-by: Oscar Craviotto <craviotto@avellaneda.com>
@alexmt alexmt added this to the v2.3 milestone Jan 1, 2022
ocraviotto added a commit to ocraviotto/argo-cd that referenced this issue Jan 1, 2022
so as to allow operators to prevent Argo CD from passing valueFiles
to helm template if they don't exist in the source under the specified path.

Signed-off-by: Oscar Craviotto <craviotto@avellaneda.com>
alexmt pushed a commit that referenced this issue Jan 3, 2022
so as to allow operators to prevent Argo CD from passing valueFiles
to helm template if they don't exist in the source under the specified path.

Signed-off-by: Oscar Craviotto <craviotto@avellaneda.com>
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 a pull request may close this issue.

3 participants