How do labels differ from annotations?

Labels can be used to select objects and to find collections of objects that satisfy certain conditions. In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels. It is possible to use labels as well as annotations in the metadata of the same object.
It’s easy to confuse when to use which because they’re both key-value objects.
The main difference between annotations and labels is that annotations aren’t meant to be used to select objects, and labels are.
Another difference is the format of a valid annotation can take the form of a domain name, such as cluster-autoscaler.kubernetes.io/safe-to-evict.
If you ever want to use selectors to select a group of pods, you would be selecting the pods by labels and never annotations.
Meld u aan om te vragen, te beantwoorden, te delen, leuk te vinden en te stemmen.