<p>I have a helm chart i need to package using the command <code>helm package</code> <a href="https://helm.sh/docs/helm/#helm-package" rel="nofollow noreferrer">https://helm.sh/docs/helm/#helm-package</a> but issue is i need to replace values.yaml file with extra config file depending on what environment</p>

<p>normally i reference this extra config file with</p>

<blockquote>
  <p><strong>for QA</strong></p>
</blockquote>

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

<blockquote>
  <p><strong>for PROD</strong></p>
</blockquote>

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

<p>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?</p>

<p>Here is what i tried</p>

<pre><code>helm package -f myvalues-qa.yaml ./redis
</code></pre>

<blockquote>
  <p>Error: unknown shorthand flag: 'f' in -f .</p>
</blockquote>

<p>What is best way to approach this?</p>

uberrebu
<p>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.</p>

<p>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:</p>

<ul>
<li><p><a href="https://github.com/roboll/helmfile" rel="nofollow noreferrer">Helmfile</a></p></li>
<li><p><a href="https://github.com/Eneco/landscaper/" rel="nofollow noreferrer">Landscaper</a></p></li>
<li><p><a href="https://github.com/reactiveops/reckoner" rel="nofollow noreferrer">Reckoner</a></p></li>
</ul>

<p>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. </p>
