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

Feature: Support for multiple values files in helm charts #659

Closed
Tracked by #2847
bazzuka opened this issue Jul 27, 2019 · 11 comments
Closed
Tracked by #2847

Feature: Support for multiple values files in helm charts #659

bazzuka opened this issue Jul 27, 2019 · 11 comments
Assignees
Labels
area/community Related to ability of community to participate in pulumi-kubernetes development area/helm kind/enhancement Improvements or new features mro2 Monica's list of 2st tier overlay related issues resolution/fixed This issue was fixed

Comments

@bazzuka
Copy link

bazzuka commented Jul 27, 2019

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

@lukehoban
Copy link
Member

lukehoban commented Jul 27, 2019

@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.

@lukehoban lukehoban added the kind/enhancement Improvements or new features label Jul 27, 2019
@bazzuka
Copy link
Author

bazzuka commented Jul 28, 2019

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)

@lblackstone lblackstone added area/community Related to ability of community to participate in pulumi-kubernetes development area/helm labels Sep 6, 2019
@darkn3rd
Copy link

darkn3rd commented Jun 16, 2020

Any update?

I was able to do this with

helm install test -f secrets.yaml -f config.yaml --dry-run --debug path/to/chart/

@lblackstone
Copy link
Member

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.

@griffithq
Copy link

Any update on this or how others are working around this?

@mikhailshilkov
Copy link
Member

@viveklak Does Helm Release support this yet?

@viveklak
Copy link
Contributor

viveklak commented Jan 8, 2022

@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

@mikhailshilkov
Copy link
Member

Brilliant! @griffithq would that be an option for you?

@magick93
Copy link

magick93 commented Mar 8, 2022

Thanks @viveklak - are there any docs on how to use this?

@mnlumi mnlumi added the mro2 Monica's list of 2st tier overlay related issues label Mar 28, 2023
@lblackstone lblackstone removed their assignment Jul 14, 2023
@EronWright
Copy link
Contributor

Here's the documentation on how to use multiple values files with the v3.Release resource:
https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#specify-helm-chart-values-in-file-and-code

Sorry to report that v3.Chart doesn't support this.

@EronWright
Copy link
Contributor

Update: the upcoming Chart v4 resource has full support for multiple values files. Enjoy!

"""A Kubernetes Python Pulumi program"""

import pulumi
from pulumi_kubernetes.helm.v4 import Chart,RepositoryOptsArgs

nginx = Chart("nginx",
    chart="bitnami/nginx",
    value_yaml_files=[
        pulumi.FileAsset("path_to_values/values.default.yaml"),
        pulumi.FileAsset("path_to_values/values.release.yaml")
    ],
    values={
        "service": {
            "type": "ClusterIP"
        },
        "notes": pulumi.FileAsset("./notes.txt")
    }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/community Related to ability of community to participate in pulumi-kubernetes development area/helm kind/enhancement Improvements or new features mro2 Monica's list of 2st tier overlay related issues resolution/fixed This issue was fixed
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

10 participants