pulumi-kubernetes
pulumi-kubernetes copied to clipboard
Feature: Support for multiple values files in helm charts
Add ability to include multiple files to helm template command, like --values values1.yaml --values values2.yaml directly from filesystem.
From helm documentation:
There are two ways to pass configuration data during install:
--values (or -f): Specify a YAML file with overrides. This can be specified multiple times and the rightmost file will take precedence --set (and its variants --set-string and --set-file): Specify overrides on the command line. If both are used, --set values are merged into --values with higher precedence.
Thanks in advance
@bazzuka what would you want this to look like in the Pulumi API?
I believe this is already possible by reading the files off disk yourself, yaml parsing them, merging the values, and passing the resulting object to the Pulumi helm chart API.
values (Optional[pulumi.Inputs]) – Optional overrides for chart values. values_files (Optional[List[Callable]) - Optional overrides for chart yaml values files. Path to yaml files with value overrides.
I wrote simple python example:
config=helm.ChartOpts(chart=chart,
namespace=namespace,
values = {'buildId': '234',
'appName': project,
'imageTag': tag,
'environment': 'release'},
values_files = ['path_to_values/values.default.yaml', 'path_to_values/values.release.yaml']
)
values_files = ['path_to_values/values.default.yaml', 'path_to_values/values.release.yaml']
extend_values_list = []
for file in values_files:
extend_values_list.append('--values')
extend_values_list.append(file)
cmd = ['helm', 'template', chart, '--name', release_name,
'--values', default_values, '--values', overrides.name]
cmd.extend(extend_values_list)
Any update?
I was able to do this with
helm install test -f secrets.yaml -f config.yaml --dry-run --debug path/to/chart/
Still on the backlog for now. If you really need this in the meantime, you can use helm template to generate the YAML, and then use yaml.ConfigGroup to manage the manifests with Pulumi.
Any update on this or how others are working around this?
@viveklak Does Helm Release support this yet?
@viveklak Does Helm Release support this yet?
Yes - this has been supported in helm release as of https://github.com/pulumi/pulumi-kubernetes/releases/tag/v3.12.1
Brilliant! @griffithq would that be an option for you?
Thanks @viveklak - are there any docs on how to use this?