-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Description
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 template
regardless 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.