Interview Prep/Helm/Chart Structure & Metadata

What are the recommended labels for chart resources?

IntermediateConceptChart Structure & Metadata
Answer

The Kubernetes recommended labels:

app.kubernetes.io/name: shop
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: shack-shop
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}

Only the stable ones (name, instance, component) go into selectors, because Deployment selectors are immutable.

All Helm questions Roadmap: Helm

More on Chart Structure & Metadata