I cannot get a value from values.yaml inside named template section, but it is available outside of the section.
I would really appreciate if somebody can clarify what is wrong.
Helm 2 and Helm 3 have the same behaviour.
Simple example templates/test.yaml
{{- define "test" -}}
# Inside define section: {{ .Values.env }}
{{- end -}}
{{ template "test"}}
---
# Outside define section: {{ .Values.env}}
values.yaml
env: env-placeholder
Output
> helm template .
---
# Source: helm-configs-template/templates/test.yaml
# Inside define section:
---
# Source: helm-configs-template/templates/test.yaml
# Outside define section: env-placeholder
I have found a solution to my question. I forgot to add a dot to
{{ template "test" .}}