<p>I am trying to do the following, so where MYVALUE in host needs to change to include Release Name. Can't figure how to do this, as you can't use env variables like <code>{{ .Release.Name }}</code> directly in to a values.yaml file.</p>
<p>I did do a <code>fullnameOverride</code> and put <code>fullnameOverride: myrelease-mysql</code> for the mysql pod and then jasper has <code>host: myrelease-mysql</code> that works  but wanted to know if there was a clever way to put release name into a values.yaml file.</p>
<p>I assumed I would need to use a configMap as can use <code>.Release.Name</code> there and then embed that config key into values.yaml.</p>
<p><strong>Values.yaml</strong></p>
<pre><code>jasperreports:
  mariadb:
    enabled: false
  externalDatabase:
    host: MYVALUE   // Also tried $MVALUE
    user: sqluser
    database: jasper
  jasperreportsUsername: jasper
  env:
      - name: MYVALUE
        valueFrom:
          configMapKeyRef:
              name: mysql-jasper
              key: mysql_releasename
</code></pre>
<p><strong>ConfigMap</strong></p>
<pre><code>kind: ConfigMap
metadata:
  name: mysql-jasper
data:
  mysql_releasename: {{ .Release.Name }}-&quot;mysql&quot;
</code></pre>

sam
<p>It seems that helm does not support any template rendering capabilities in  a <code>values.yaml</code> file - there are multiple topics on the helm GitHub:</p>
<ul>
<li><a href="https://github.com/helm/helm/issues/9754" rel="nofollow noreferrer">Canonical way of using dynamic object names within values.yaml</a></li>
<li><a href="https://github.com/helm/helm/pull/6876" rel="nofollow noreferrer">Adding values templates in order to customize values with go-template, for the chart and its dependencies</a></li>
<li><a href="https://github.com/helm/helm/issues/2492" rel="nofollow noreferrer">Proposal: Allow templating in values.yaml</a></li>
</ul>
<p>For now this feature is not implemented so you need to find a workaround - the suggestion from David Maze seems to be a good direction, but if you want to follow your approach you can use below workaround <a href="https://helm.sh/docs/helm/helm_install/#helm-install" rel="nofollow noreferrer">using <code>--set</code> flag in the <code>helm install</code> command</a> or use <code>sed</code> command and pipe to <code>helm install</code> command.</p>
<p>First solution with <code>--set</code> flag.</p>
<p>My <code>values.yaml</code> file is little bit different than yours:</p>
<pre class="lang-yaml prettyprint-override"><code>mariadb:
  enabled: false
externalDatabase:
  user: sqluser
  database: jasper
jasperreportsUsername: jasper
</code></pre>
<p>That's because when I was using your <code>values.yaml</code> I couldn't manage to apply these values to <code>bitnami/jasperreports</code> chart, the <code>helm install</code> command was using default values <a href="https://github.com/bitnami/charts/blob/master/bitnami/jasperreports/values.yaml" rel="nofollow noreferrer">from here</a>.</p>
<p>I'm setting a shell variable <code>RELEASE_NAME</code> which I will use both for setting chart name and <code>externalDatabase.host</code> value.</p>
<pre><code>RELEASE_NAME=my-test-release
helm install $RELEASE_NAME bitnami/jasperreports -f values.yaml --set externalDatabase.host=$RELEASE_NAME-mysql
</code></pre>
<p>The above <code>helm install</code> command will override default values both by setting values from the <code>values.yaml</code> file + setting <code>externalDatabase.host</code> value.</p>
<p>Before applying you can check if this solution works as expected by using <code>helm template</code> command:</p>
<pre><code>RELEASE_NAME=my-test-release
helm template $RELEASE_NAME bitnami/jasperreports -f values.yaml --set externalDatabase.host=$RELEASE_NAME-mysql
...
- name: MARIADB_HOST
  value: &quot;my-test-release-mariadb&quot;
...
</code></pre>
<p>Another approach is to set a bash variable <code>RELEASE_NAME</code> which will be used in the <code>sed</code> command to output modified <code>values.yaml</code> file (I'm not editing <code>values.yaml</code> file itself).  This output will be pipe into a <code>helm install</code> command (where I also used the<code>RELEASE_NAME</code> variable).</p>
<p><code>values.yaml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>mariadb:
  enabled: false
externalDatabase:
  host: MYHOST
  user: sqluser
  database: jasper
jasperreportsUsername: jasper
</code></pre>
<pre><code>RELEASE_NAME=my-test-release
sed &quot;s/MYHOST/$RELEASE_NAME-mysql/g&quot; values.yaml | helm install $RELEASE_NAME bitnami/jasperreports -f -
</code></pre>
<p>This approach will set chart configuration the same as in the first approach.</p>
