<p>I have a Helm chart and in the deployment, I want to provide some environment variable for my pods. During build time in my CI/CD setup, I have the values as env vars and I'm passing them now like this:</p>
<pre><code>helm upgrade CHART_NAME helm --install --set-string webserver.env.DATABASE_URL=$DATABASE_URL
</code></pre>
<p>I have like more then 20 env vars, can I access them somehow in my values.yml?</p>
<pre><code>webserver:
  env:
    DATABASE_URL=${DATABASE_URL}
</code></pre>
<p>Sadly this one doesn't work.</p>

ghostika
<p>Helm does not resolve placeholders (environment variables) inside <code>values</code> files, but you can do it yourself in the CI/CD script, before passing the file to the <code>helm upgrade</code> command:</p>
<p><strong>values-env.yaml:</strong></p>
<pre class="lang-yaml prettyprint-override"><code>webserver:
  env:
    DATABASE_URL=${DATABASE_URL}
</code></pre>
<p><strong>CI/CD script:</strong></p>
<pre class="lang-sh prettyprint-override"><code>eval &quot;echo \&quot;$(cat values-env.yaml)\&quot;&quot; &gt;&gt; values-ci.yaml
helm upgrade CHART_NAME helm --install --values values-ci.yaml

</code></pre>
