Template Helpers
The standard chart exposes a set of named Helm template helpers (defined in templates/_helpers.tpl) that application charts built on top of standard can call directly. These helpers centralise naming and labelling logic so every chart in the repository behaves consistently.
Naming helpers
standard.chartName
Returns the chart name. Falls back to $.Chart.Name unless chartName is set in values.
chartName: myapp # overrides Chart.namestandard.chartVersion
Returns the chart version. Falls back to $.Chart.Version unless chartVersion is set in values.
standard.chart
Returns <chartName>-<chartVersion> truncated to 63 characters, with + replaced by _. Used as the value for the helm.sh/chart label.
standard.version
Returns the application version. Resolves in order: values.version → Chart.AppVersion.
version: "1.2.3" # overrides Chart.AppVersionstandard.release
Returns the Helm release name. Can be decoupled from the Kubernetes resource names by setting releaseName:
releaseName: myapp # resource names use "myapp" regardless of the Helm release namestandard.name
Returns the application name used for the app.kubernetes.io/name label. Resolves in order:
| Condition | Result |
|---|---|
nameOverride set | nameOverride (truncated to 63 chars) |
chart name is standard | release name |
| otherwise | chart name |
The fallback to release name when the chart is the generic standard wrapper prevents the meaningless value standard from appearing in labels.
standard.fullname
Returns the fully qualified application name used as the base for resource names. Resolves in order:
| Condition | Result |
|---|---|
fullnameOverride set | exactly fullnameOverride |
nameOverride set and release contains it | just <release> |
nameOverride set | <release>-<nameOverride> |
chart name is standard | just <release> |
| release already contains the chart name | just <release> |
| otherwise | <release>-<chartName> |
See Resource Naming for the full decision table with examples.
standard.resourcename
Returns the name portion of a specific resource (e.g. a deployment key). Uses object.nameOverride if set, otherwise object.name. Expects a context with an object key.
standard.resourcefullname
Returns the fully qualified name of a specific resource. Resolves in order:
| Condition | Result |
|---|---|
object.fullnameOverride set | exactly fullnameOverride |
prefix set in context | <fullname>-<prefix>-<resourcename> |
fullname already contains resourcename | just <fullname> (deduplication) |
| otherwise | <fullname>-<resourcename> |
The prefix is used internally for CronJobs (cronjob) and Jobs (job) so their names never collide with Deployments sharing the same key.
Label helpers
standard.labels
Renders the full set of recommended Kubernetes labels applied to every resource:
helm.sh/chart: <chart>-<version>
app.kubernetes.io/name: <name>
app.kubernetes.io/instance: <release>
app.kubernetes.io/version: "<version>"
app.kubernetes.io/managed-by: Helmstandard.selectorLabels
Renders only the labels used in selector.matchLabels. These are immutable after first deploy:
app.kubernetes.io/name: <name>
app.kubernetes.io/instance: <release>
app.kubernetes.io/deployment: <deployment-key> # only when a deployment context is presentThe deployment label is injected for multi-deployment charts so that each Deployment's selector is unique within the release.
Miscellaneous helpers
standard.serviceAccountName
Returns the service account name to use for pods:
| Condition | Result |
|---|---|
serviceAccount.create: true | serviceAccount.name if set, otherwise fullname |
serviceAccount.create: false | serviceAccount.name if set, otherwise default |
standard.image
Constructs the full container image reference from image.registry, image.repository, image.name, and the resolved tag. The tag is coerced to a string so numeric values (e.g. a plain git SHA like 70695922) render as quoted YAML and not as integers, which would break image pulls.
Tag resolution order: image.tag → values.version → Chart.AppVersion.
image:
registry: "" # e.g. "registry.example.com/"
repository: myorg/
name: myapp
tag: "" # falls back to version / appVersionResult: myorg/myapp:1.2.3
Calling helpers from application charts
Application charts that depend on standard can call any of these helpers directly by their fully qualified name:
# charts/myapp/templates/deployment.yaml
metadata:
name: {{ include "standard.fullname" . }}
labels:
{{- include "standard.labels" . | nindent 4 }}Because the helpers resolve values from $.Values and $.Chart, they work correctly whether called from within the standard chart or from a dependent chart that passes its own context.