Concept and Usage
Labels
Properties attached to each item (pod, deployment, etc.). Used to identify and group objects.
Selectors
Used to filter items based on their labels.
Annotations
Used to record additional information for your records, like
buildVersion, author, etc. Not used for selection.Filtering with Selectors
Example Deployment
Themetadata.labels field on the Deployment itself labels the Deployment object. The spec.selector.matchLabels and spec.template.metadata.labels are used to link the ReplicaSet to its Pods.