github.com/koderover/helm@v2.17.0+incompatible/docs/chart_best_practices/labels.md (about)

     1  # Labels and Annotations
     2  
     3  This part of the Best Practices Guide discusses the best practices for using
     4  labels and annotations in your chart.
     5  
     6  ## Is it a Label or an Annotation?
     7  
     8  An item of metadata should be a label under the following conditions:
     9  
    10  - It is used by Kubernetes to identify this resource
    11  - It is useful to expose to operators for the purpose of querying the system.
    12  
    13  For example, we suggest using `helm.sh/chart: NAME-VERSION` as a label so that operators
    14  can conveniently find all of the instances of a particular chart to use.
    15  
    16  If an item of metadata is not used for querying, it should be set as an annotation
    17  instead.
    18  
    19  Helm hooks are always annotations.
    20  
    21  ## Standard Labels
    22  
    23  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
    24  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.
    25  
    26  Name|Status|Description
    27  -----|------|----------
    28  `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.
    29  `helm.sh/chart` | REC | This should be the chart name and version: `{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}`.
    30  `app.kubernetes.io/managed-by` | REC | This should always be set to `{{ .Release.Service }}`. It is for finding all things managed by Tiller.
    31  `app.kubernetes.io/instance` | REC | This should be the `{{ .Release.Name }}`. It aids in differentiating between different instances of the same application.
    32  `app.kubernetes.io/version` | OPT | The version of the app and can be set to `{{ .Chart.AppVersion }}`.
    33  `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`.
    34  `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.
    35  
    36  You can find more information on the Kubernetes labels, prefixed with `app.kubernetes.io`, in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/).