package helm chart referencing extra config file

5/1/2019

I have a helm chart i need to package using the command helm package https://helm.sh/docs/helm/#helm-package but issue is i need to replace values.yaml file with extra config file depending on what environment

normally i reference this extra config file with

for QA

helm install -f myvalues-qa.yaml -f override-qa.yaml --set foo=bar-qa --set foo=newbar-qa ./redis

for PROD

helm install -f myvalues-prod.yaml -f override-prod.yaml --set foo=bar-prod --set foo=newbar-prod ./redis

but now since i want to package this redis helm charts, how do i package it so that i can switch which config files or extra vars depending the environment?

Here is what i tried

helm package -f myvalues-qa.yaml ./redis

Error: unknown shorthand flag: 'f' in -f .

What is best way to approach this?

-- uberrebu
kubernetes
kubernetes-helm

1 Answer

5/1/2019

When packaging a Helm chart it isn't possible to customize values. That's because of a helm chart is a generic definition of an app, reusable for one environment to another, which is customized at installing via values.

Apart from that, I understand that you need a way to store the definition of a release (including the helm chart and the values) for every specific environment. There are plenty of tools that let you define a release in a declarative way, here are some:

So, you have a packaged chart where you store the generic app and another file(s) where you store the definitions of the releases of this chart.

-- Ignacio Millán
Source: StackOverflow