Difficulty: Beginner
Explain Labels and Selectors. How are they used in Kubernetes?
**Labels** are key-value pairs attached to objects (like Pods) to organize and select subsets of objects. They don't provide uniqueness but define attributes.
**Selectors** are used to filter objects based on their labels. They are the 'glue' that connects components. For example, a Service uses a Selector to find which Pods to send traffic to.
Usage: - **Equality-based**: `app=web`, `env!=prod` - **Set-based**: `env in (staging, qa)`, `tier notin (frontend)`
Labels, Selectors, MetaData, Filtering