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.
More on Chart Structure & Metadata
What files does `helm create mychart` generate and which ones matter?BeginnerWhat are the required fields in `Chart.yaml`?BeginnerWhat is the difference between `version` and `appVersion`?BeginnerWhy should `appVersion` be quoted in `Chart.yaml`?BeginnerWhat does `type: library` vs `type: application` mean?BeginnerWhat is the `kubeVersion` field used for?Intermediate