<p>Please! Is it possible to squash multiple helm templates into one and then refer to it as a one-liner in a deployment file?</p>

<p>EG: </p>

<pre><code> {{- define "foo.deploy" -}} 
 value:
   {{- include "foo.1" . | nindent 6 }}
   {{- include "foo.2" . | nindent 6 }}
   {{- include "foo.3" . | nindent 6 }}
</code></pre>

<p>And then do an <strong>{{- include "foo.deploy" . }}</strong> in a separate deployment file.</p>

<p>Which should then contain foo.1, foo.2 and foo.3, and their respective definitions.</p>

<p>As opposed to literally writing out all three different 'includes' especially if you've got loads.</p>

<p>Much appreciated,</p>

<p>Thanks,</p>

Hammed
<p>A <strong>named template</strong> (sometimes called a partial or a subtemplate) is simply a template defined inside of a file, and given a name. We’ll see two ways to create them, and a few different ways to use them.
Template names are global. As a result of this, if two templates are declared with the same name the last occurrence will be the one that is used. Since templates in subcharts are compiled together with top-level templates, it is best to name your templates with chart specific names. A popular naming convention is to prefix each defined template with the name of the chart: {{ define &quot;mychart.labels&quot; }}.</p>
<p>More information about named templates you can find here: <a href="https://helm.sh/docs/chart_template_guide/named_templates/" rel="nofollow noreferrer">named-template</a>.</p>
<p>Proper configuration file should look like:</p>
<pre><code>{{/* Generate basic labels */}}
{{- define &quot;mychart.labels&quot; }}
  labels:
    generator: helm
    date: {{ now | htmlDate }}
{{- end }}
</code></pre>
<p>In your case part of file should looks like:</p>
<pre><code>{{- define &quot;foo.deploy&quot; -}} 
{{- include &quot;foo.1&quot; . | nindent 6 }}
{{- include &quot;foo.2&quot; . | nindent 6 }}
{{- include &quot;foo.3&quot; . | nindent 6 }}
{{ end }}
</code></pre>
