Per-chart chartHome in kustomization.ayml #5775
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Eschewed features
What would you like to have added?
Add a
chartHome
property to the each entry inhelmCharts
, which overrides the globalhelmGlobals.chartHome
property when present.For example, the following should be possible:
Why is this needed?
First, the current way of specifying this parameter (described below) is confusing. The URL to a remote repositories are specified by
helmCharts[*].repo
. The path to a local repository is specified byhelmGlobals.chartHome
, which is in a different YAML map and is specified differently than when manually configuringHelmChartInflationGenerator
via an external YAML file.Second, it status quo makes it difficult to install local charts from more than one directory because
helmGlobals.chartHome
is global. There is a workaround, but it is non-obvious and complicateskustomization.yaml
by requiring the creation of a separate YAML file for each chart. I also not sure if this way of instantiating not even sure if this way of instantiatingHelmChartInflationGenerator
is supported, since I was unable to find any reference to this way of instantiating it in the Kustomize documentation.Can you accomplish the motivating task without this feature, and if so, how?
Yes, but it is awkard.
HelmChartInflationGenerator
can install a Helm chart at the relative pathpath/to/my/repo_name/chart_name
with the following configuration:This works if all
helmCharts
entries inkustomization.yaml
share the same parent directory becausechartHome
is shared by all charts in the file. The solution is more complex if you need to install Helm charts from multiple repositories.The workaround is to create a separate
HelmChartInflationGenerator
instance for each chart you want to install, then reference them inkustomization.yaml
:Here is an example of what one of the
-generator.yaml
files might contain.This works because
HelmChartInflationGenerator
allowschartHome
to be specified on a per-chart basis, unlikekustomization.yaml
where it is global for the entire file.What other solutions have you considered?
The status quo. While it is possible to workaround the lack of this feature, I don't think this is a good solution. It might take more effort to document the workaround and educate users than to make the configuration more intuitive.
Use the existing
repo
field inhelmCharts
. If the value is afile://
or local path, it could be interpreted as achartHome
override rather than a remote URL. This is arguably a better solution because it eliminates the (confusing) distinction between local and remote repositories. However, it would be tricky to get the parsing exactly right. Any bugs in the parsing logic could prevent a user from installing a remote chart.Anything else we should know?
This led myself and several others to erroneously believe that
HelmChartInflationGenerator
did not support installing from a local repository in #4378.I would expect most users of ArgoCD or Flux who use Kustomize to eventually run into this problem. It is common to have Helm charts from multiple repositories. It is also common to have a maintain cache of a Helm repository to avoid network, permission, and versioning issues.
Feature ownership
I have not contributed to Kustomize before -- so I am unfamiliar with the development environment and submission process. I am open to learning and taking a stab at imlpementing this myself, if is not too difficult to ramp up.
The text was updated successfully, but these errors were encountered: