Recommended Labels
Fleeting- External reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
- External reference: https://helm.sh/docs/chart_best_practices/labels/
Recommended Labels | Kubernetes
In order to take full advantage of using these labels, they should be applied on every resource object.
Key Description Example Type app.kubernetes.io/name The name of the application mysql string app.kubernetes.io/instance A unique name identifying the instance of an application mysql-abcxzy string app.kubernetes.io/version The current version of the application (e.g., a semantic version, revision hash, etc.) 5.7.21 string app.kubernetes.io/component The component within the architecture database string app.kubernetes.io/part-of The name of a higher level application this one is part of wordpress string app.kubernetes.io/managed-by The tool being used to manage the operation of an application — https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
The following table defines common labels that Helm charts use. Helm itself never requires that a particular label be present. Labels that are marked REC are recommended, and should be placed onto a chart for global consistency. Those marked OPT are optional. These are idiomatic or commonly in use, but are not relied upon frequently for operational purposes.
Name Status Description app.kubernetes.io/name REC This should be the app name, reflecting the entire app. Usually {{ template “name” . }} is used for this. This is used by many Kubernetes manifests, and is not Helm-specific. helm.sh/chart REC This should be the chart name and version: {{ .Chart.Name }}-{{ .Chart.Version -> replace “+” “_” }}. app.kubernetes.io/managed-by REC This should always be set to {{ .Release.Service }}. It is for finding all things managed by Helm. app.kubernetes.io/instance REC This should be the {{ .Release.Name }}. It aids in differentiating between different instances of the same application. app.kubernetes.io/version OPT The version of the app and can be set to {{ .Chart.AppVersion }}. app.kubernetes.io/component OPT This is a common label for marking the different roles that pieces may play in an application. For example, app.kubernetes.io/component: frontend. app.kubernetes.io/part-of OPT When multiple charts or pieces of software are used together to make one application. For example, application software and a database to produce a website. This can be set to the top level application being supported.
Notes linking here
- how to set the component/part-of values of kubernetes?
- how to set the component/part-of values of kubernetes?
- kubernetes - what k8s-app label represent?