<p>I know there are many questions around this but I didn't find any with a real answer.</p>

<p>My helm chart have dependencies from another helm charts and I need to override their values with my <code>.Release.Name</code> and <code>.Release.Namespace</code>.</p>

<p><strong>My requeriments.yaml</strong></p>

<pre><code>dependencies:
- name: keycloak
  alias: keycloak-config
  repository: https://my-repository.com/
  version: 1.0.0
- name: kong
  alias: kong-config
  repository: https://my-repository.com/
  version: 1.0.0
</code></pre>

<p><strong>On my values.yaml</strong></p>

<pre><code>kong-config:
  websso:
    service:
      fullnameOverride: "my-helm._RELEASE_NAMESPACE_.svc.cluster.local"
      ckngOauth2Opts: "--data config.post_logout_redirect_uri=/_RELEASE_NAME_
                       --data config.logout_path=/_RELEASE_NAME_/logout"
</code></pre>

<p>I basically need to use <code>{{ .Release.Name }}</code> where I have <code>_RELEASE_NAME_</code> and <code>{{ .Release.Namespace }}</code> where I have <code>_RELEASE_NAMESPACE_</code>.</p>

<p>I already tried:</p>

<ul>
<li><code>{{ .Release.Name }}</code> and <code>{{ .Release.Namespace }}</code></li>
<li><code>$RELEASE_NAME</code> and <code>$RELEASE_NAMESPACE</code></li>
<li><code>${RELEASE_NAME}</code> and <code>${RELEASE_NAMESPACE}</code></li>
</ul>

<p>but nothing works.</p>

<p>Note I really need to access those values at <code>values.yaml</code>. I don't have access to my dependencies code to change and set that values on that.</p>

<p>How can I solve this?</p>

<p>While it does not appear that helm, itself, can do that, <a href="https://github.com/roboll/helmfile#readme" rel="nofollow noreferrer">helmfile</a> can via either its <a href="https://github.com/roboll/helmfile#helmfile--kustomize" rel="nofollow noreferrer">integration with kustomize</a> or with its <a href="https://github.com/roboll/helmfile#hooks" rel="nofollow noreferrer"><code>prepare</code> hook</a>. I'll show the <code>prepare</code> hook because it's much shorter</p>

<pre class="lang-yaml prettyprint-override"><code>releases:
- name: kong-config
  chart: whatever/kong
  version: 1.0.0
  values:
  - ./generated-values.yaml
  hooks:
  - events: ['prepare']
    command: bash
    args:
    - -c
    - |
      printf 'websso:\n  service:\n    fullnameOverride: my-helm.{{`{{ .Release.Namespace }}`}}.svc.cluster.local\n' &gt; generated-values.yaml
</code></pre>
