<p>I'm refactoring a helm chart, and wanted to put some values from <code>deployment.yaml</code> to <code>values.yaml</code> and that value is</p>
<pre><code>hosts:
  - {{ include &quot;myApp.externalHostName&quot; . | quote }}
</code></pre>
<p>but it gives me the error</p>
<pre><code>[ERROR] values.yaml: unable to parse YAML: error converting YAML to
 JSON: yaml: invalid map key: map[interface {}]interface {}{&quot;toJson
 include \&quot;myApp.externalHostName\&quot; . | quote&quot;:interface {}(nil)}

[ERROR] templates/: cannot load values.yaml: error converting YAML to
 JSON: yaml: invalid map key: map[interface {}]interface {}{&quot;toJson
 include \&quot;myApp.externalHostName\&quot; . | quote&quot;:interface {}(nil)}
</code></pre>
<p>it would work if I just used</p>
<pre><code>hosts:
  - myExternalHostname.something
</code></pre>
<p>but is it possible to run include in values.yaml?</p>

<p>The <code>values.yaml</code> files are not subject to golang interpolation. If you need dynamic content, you'll need to update files inside the <code>templates</code> directory (which are subject to golang interpolation), or generate the <code>values.yaml</code> content using another mechanism</p>
<p>In this specific case, you may find yaml anchors to be helpful:</p>
<pre class="lang-yaml prettyprint-override"><code>myApp:
  externalHostName: &amp;externalHostName myapp.example.com

theIngressOrWhatever:
  hosts:
  - *externalHostName
</code></pre>
