Labels are a set of key/value pairs, which are attached to object metadata. We could use labels to select, organize, and group objects, such as Pods, ReplicaSets, and Services. Labels are not necessarily unique. Objects could carry the same set of labels.
Label selectors are used to query objects with labels of the following types:
- Equality-based:
- Use equal (= or ==) or not-equal (!=) operators
- Set-based:
- Use in or notin operators