<p>In one of our helm charts we have a values file per environment e.g.</p>
<pre><code>app-helm-chart:
  dev-values.yaml
  test-values.yaml
  Chart.yaml
  templates
    deployment.yaml
    service.yaml
    ingress.yaml
  Readme.md
</code></pre>
<p>We have packaged up the helm chart using helm package and are then trying to install it from our helm repository.</p>
<p>Is there a way to specify to use the dev-values file from within the package as part of the install command?</p>
<p>Trying to package and version the values and templates all in one place if possible.</p>
<p>Thanks</p>

gdix0n
<p>There are two answers to this question.</p>
<p>First one, using your current package and repo setup, you would need to download and extract the package then call the values file from the chart folder</p>
<pre><code>helm repo add test-repo http://url/to/your repo
helm repo update
helm fetch test-repo/my-chart-name --untar [--version x.x.x]  #This creates a directory called &quot;my-chart-name&quot; in the local directory
helm upgrade --install --atomic --wait ./my-chart-name/ -f ./mychart-name/dev-values.yaml
</code></pre>
<p>The second, better way, and this was already hinted to by Gaël J is not to include environment-specific values in the chart -- because if you do, each time you change the values or add new values, you'll need to repackage the chart and update the chart repo.</p>
<p>The better way, and the way we do it is to have a separate folder, something like this</p>
<pre><code>.
├── charts
│   └── my-chart
│       ├── Chart.lock
│       ├── charts
│       │   └── ingress-nginx-3.35.0.tgz
│       ├── Chart.yaml
│       ├── README.md
│       └── templates
│           ├── deployment.yaml
│           ├── _helpers.tpl
│           ├── ingress.yaml
│           ├── NOTES.txt
│           ├── serviceaccount.yaml
│           └── service.yaml
├── profiles
│   ├── values-preprod.yaml
│   └── values-prod.yaml
</code></pre>
<p>In this way, I can update the profiles yaml freely and then use the local (or remote) chart -- and the chart contents or version don't need to change whenever I update the values.</p>
<pre><code>helm upgrade --install --atomic --wait ./charts/my-chart -f profiles/values-preprod.yaml
</code></pre>
<p>or</p>
<pre><code>helm upgrade --install --atomic --wait test-repo/my-chart -f profiles/values-preprod.yaml
</code></pre>
