Helm
Kubernetes
Release Name
Configuration
DevOps

Helm how to define .Release.Name value

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

In Helm, .Release.Name is not a value you normally define inside values.yaml. It is supplied by Helm itself when you install or upgrade a chart. That is why attempts to set it from template data usually fail or produce confusing behavior.

Where .Release.Name Comes From

A Helm release is a named installation of a chart in a cluster. Helm injects metadata about that installation into the template context, including .Release.Name, .Release.Namespace, and .Release.Service.

In Helm 3, you choose the release name on the command line:

bash
helm install my-release ./mychart

Inside templates, Helm makes that name available as .Release.Name.

yaml
1apiVersion: v1
2kind: ConfigMap
3metadata:
4  name: {{ .Release.Name }}-config

If the release name is my-release, the rendered name becomes my-release-config.

You Do Not Set .Release.Name in values.yaml

This is the most important distinction. values.yaml controls chart-defined inputs. .Release.Name is runtime metadata from Helm itself.

So this does not change the release name:

yaml
releaseName: demo

You may still use your own value named releaseName, but it is just .Values.releaseName, not .Release.Name.

yaml
1metadata:
2  labels:
3    custom-name: {{ .Values.releaseName }}
4    helm-release: {{ .Release.Name }}

Those are different concepts.

Helm 3 Syntax and Generated Names

Older articles often mention helm install --name ..., which was Helm 2 syntax. In Helm 3, the release name is a positional argument.

bash
helm install prod-api ./chart

If you do not want to choose a name manually, Helm can generate one:

bash
helm install ./chart --generate-name

That still produces a .Release.Name; Helm just chooses it for you.

nameOverride and fullnameOverride Are Not the Same Thing

Many charts expose nameOverride or fullnameOverride in values.yaml. Those values change resource naming conventions inside the chart, but they do not redefine Helm's release metadata.

For example:

yaml
nameOverride: api
fullnameOverride: api-prod

A helper template may use those values to compute Kubernetes resource names, while .Release.Name remains whatever Helm installed the release as.

This distinction matters when you:

  • upgrade a release by name
  • look up it with helm list
  • use .Release.Name in selectors or labels

Template Example With a Helper

Many charts centralize naming in _helpers.tpl.

yaml
{{- define "mychart.fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Then resources use the helper:

yaml
metadata:
  name: {{ include "mychart.fullname" . }}

This is cleaner than repeating string logic across multiple templates.

Overriding the Release Name During Upgrade

You do not usually rename a release during helm upgrade. Instead, you upgrade the existing named release.

bash
helm upgrade my-release ./mychart

If you need a different release name, that is typically a separate installation, not a renamed one.

When to Use .Release.Name

Use .Release.Name when the resource should be tied to the actual installed release. Good examples include labels, names, and selectors that must stay consistent across the chart.

Use chart values when the user should be able to control naming independently of the release identity.

Common Pitfalls

A common mistake is trying to assign .Release.Name in values.yaml. Helm does not read it from there.

Another mistake is following Helm 2 examples that use --name. In Helm 3, the release name is passed as the first argument to helm install.

Developers also confuse .Release.Name with nameOverride or fullnameOverride. They can influence rendered resource names, but they do not change the release object's actual name.

Summary

  • '.Release.Name is set by Helm at install time, not by values.yaml.'
  • In Helm 3, define it with helm install my-release ./chart.
  • '--generate-name lets Helm choose the release name automatically.'
  • 'nameOverride and fullnameOverride affect chart naming logic, not the release identity.'
  • Use .Release.Name for release-bound metadata and values for user-controlled naming.

Course illustration
Course illustration

All Rights Reserved.