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

Cannot override Helm values.yaml file reference #1251

Closed
Freakazoid182 opened this issue Aug 14, 2020 · 5 comments
Closed

Cannot override Helm values.yaml file reference #1251

Freakazoid182 opened this issue Aug 14, 2020 · 5 comments
Assignees
Labels
area/helm resolution/by-design This issue won't be fixed because the functionality is working as designed

Comments

@Freakazoid182
Copy link

Problem description

Some charts provide several values.yaml files. For instance in the bitnami repository you often see a separate file for production:
https://github.com/bitnami/charts/blob/master/bitnami/prometheus-operator/values-production.yaml

The default values for charts is always taken from values.yaml which is hardcoded.
Currently there is no way to reference another file to set default values as far as I can see.
Is it intentional that the file reference is hardcoded? It seems useful to allow selecting another one as the default values.yaml.

dotnet:

defaultValues = Path.Join(chartDirectoryName, fetchedChartName, "values.yaml");

nodejs:

nodepath.join(chartDir.name, fetchedChartName, "values.yaml")

nodepath.join(chartDir.name, fetchedChartName, "values.yaml")

go

defaultVals := filepath.Join(chart, "values.yaml")

defaultVals := filepath.Join(chart, "values.yaml")

python

default_values = os.path.join(chart, 'values.yaml')

default_values = os.path.join(chart, 'values.yaml')

Suggestions for a fix

I would suggest we make values.yaml overridable through BaseChart(Arg/Opts) (depending on language).

If that's ok, what would be the preferred approach here? I'm happy to provide a PR.

@leezen leezen added this to the current milestone Aug 25, 2020
@lblackstone
Copy link
Member

This is also somewhat related to #659

@leezen leezen removed this from the current milestone Nov 2, 2020
@wuqunfei
Copy link

@leezen , do you have some update of this requirement? because there are so many helm values.yaml file in existing legancy environment. It is quite hard to rewrite into code. It is a really useful function to imgrate existing helm system smoothly.

@squaremo
Copy link
Contributor

IIUC, the Helm spec has it that the values.yaml file provides defaults -- that's why it will be hard-coded in the library.

Vendors sometimes include values-xyz.yaml files as examples of non-default configuration you might want to use, but they have no status other than providing an example. The way you'd use an example like that would be to download the file from the repo, or copy its contents into a local file, then refer to it when you invoke Helm:

helm install [...] --values ./values-production.yaml

Bitnami removed all of the values_production.yaml files from charts there, on the basis that people were getting the wrong idea (!): bitnami/charts#5095

@oplancelot
Copy link

@leezen , do you have some update of this requirement? because there are so many helm values.yaml file in existing legancy environment. It is quite hard to rewrite into code. It is a really useful function to imgrate existing helm system smoothly.

I can't agree with you more,any update?

@squaremo squaremo added area/helm resolution/by-design This issue won't be fixed because the functionality is working as designed labels Aug 22, 2022
@squaremo
Copy link
Contributor

squaremo commented Aug 22, 2022

I don't think this will be addressed as it's formulated -- the values.yaml file is part of the chart, not something you supply when you install the chart. When values-*.yaml files are included with the chart, they are as examples, or for overlaying on the defaults. To use them with the Helm command line tool, you would either refer to them with the flag -f to combine them with the defaults, or build you own chart which adapts the values.yaml file to your chosen defaults.

That said, helm.Chart does not support referring to a file for overlay values (https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/chart/#inputs), the equivalent of -f, so there is certainly a lack here. The issue #659 covers that lack.

helm.Release does let you refer to files for values (https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#valueyamlfiles_go). If you can use a helm.Release instead of a helm.Chart, that will avoid the limitation of helm.Chart not supporting values from files.

I'm going to close this issue as "by design", since #659 addresses the problem given here, in line with how the Helm tooling itself works. (If anyone has a reason #659 cannot solve their problem in the way this issue would, we can always reopen this one.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm resolution/by-design This issue won't be fixed because the functionality is working as designed
Projects
None yet
Development

No branches or pull requests

6 participants