Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the usage of include in helm

I searched a lot but didnt get a right answer, what is the difference between include and {{}} in helm.

ex :

metadata:
  name: {{ include "cluster-dev.fullname" . }}

here can't it be like this

metadata:
  name: {{ Values.nameOverride }}
like image 880
Jithin Kumar S Avatar asked Sep 10 '25 22:09

Jithin Kumar S


1 Answers

include is meant to be used with templates and not to simply output values.

According to the documentation

To make it possible to include a template, and then perform an operation on that template’s output, Helm has a special include function:

{{ include "toYaml" $value | indent 2 }}

The above includes a template called toYaml, passes it $value, and then passes the output of that template to the indent function.

like image 192
brass monkey Avatar answered Sep 13 '25 10:09

brass monkey