Kubernetes Labels and Annotations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 21: Line 21:


=<span id='Annotation'></span>Annotations=
=<span id='Annotation'></span>Annotations=
{{External|https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/}}


An annotation contains non-identifying information. The information exposed by annotations is not used internally by Kubernetes. They cannot be used in selectors. The annotation keys and values are not constrained.
An annotation contains non-identifying information. The information exposed by annotations is not used internally by Kubernetes. They cannot be used in selectors. The annotation keys and values are not constrained.

Revision as of 04:04, 27 October 2020

Internal


Labels

A label is a key/value pair contains identifying information used to organize and categorize (scope and select) objects.

Labels are used by selector queries, or within selector sections of object definitions. Replicaset controllers and services use selectors to identify the pods that fall under their scope.

Labels is a mechanism to define loose couplings.

The structure of keys and values is constrained, so they can be evaluated quickly.

TODO:

For a specific object declaration, the labels are specified in the metadata section of the manifest.

Annotations

https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/


An annotation contains non-identifying information. The information exposed by annotations is not used internally by Kubernetes. They cannot be used in selectors. The annotation keys and values are not constrained.