<p>Depending on a subchart via requirements.yaml results in the template being rendered. I'm aware that I can use aliases to have more than one copy of a subchart, but is there a way to prevent the subchart to be rendered by default and instead <code>included</code> as a template, along the lines of:</p>
<pre><code>{{- $root := . }}

{{- range $i, $service := .Values.services }}
---
{{ $k8sDeployment := (include &quot;MY_SUBCHART_NAME&quot; (dict &quot;top&quot; $root &quot;deployment&quot; $service)) | fromYaml }}
{{ include &quot;deployment&quot;  (dict &quot;top&quot; $root &quot;deployment&quot; $k8sDeployment) }}
---
{{ $k8sService := (include &quot;MY_SUBCHART_NAME2&quot; $service) | fromYaml }}
{{ include &quot;service&quot; (dict &quot;top&quot; $root &quot;service&quot; $k8sService) }}
{{- end -}}
</code></pre>

sumek
<p>No, there's no way to do this.  Helm dependencies (both in Helm 2 and Helm 3) work only as things that are installed in the cluster under the same Helm release name.  Without using something like a <a href="https://docs.helm.sh/docs/topics/advanced/#post-rendering" rel="nofollow noreferrer">post-renderer</a> to manipulate the produced YAML, there's no way to include only part of a dependency chart or to re-include its Kubernetes objects with different parameters.</p>
<p>One could imagine the subchart being specifically designed to be used this way.  The subchart would have to provide the templates you're trying to call, and its <code>templates/*.yaml</code> file would call those templates with standard values inside an <code>if</code> block, and then your parent chart could depend on the subchart with a value that disabled its normal output.  Most charts aren't built this way, though.</p>
