<p>I would like to be able to reference the current namespace in <code>values.yaml</code> to use it to suffix some values like this</p>

<pre><code># in values.yaml
someParam: someval-{{ .Release.Namespace }}
</code></pre>

<p>It much nicer to define it this way instead of going into all my templates and adding <code>{{ .Release.Namespace }}</code>. If I can do it in <code>values.yaml</code> it's much clearer and only needs to be defined in one place.</p>

red888
<p>You can use <a href="https://helm.sh/docs/chart_template_guide/#named-templates" rel="nofollow noreferrer">named templates</a> to define re-usable helper templates.  E.g.</p>

<p>In <code>templates/_helpers.tpl</code>:</p>

<pre><code>{{- define "myChart.someParam" -}}someval-{{ .Release.Namespace }}{{- end -}}
</code></pre>

<p>In <code>templates/configmap.yaml</code> (for example):</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: something
data:
  foo: {{ template "myChart.someParam" . }}
</code></pre>

<p>The result:</p>

<pre><code>$ helm template . --namespace=bar
---
# Source: helm/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: something
data:
  foo: someval-bar
</code></pre>
