A label selector identifies Kubernetes resources by their assigned labels. Labels are key-value attributes used to identify and organize resources; a selector turns matching labels into a dynamic group of targets. section 3.2.6
Selectors serve two distinct purposes:
- A Service uses a selector to link to the Pods running an application. This lets clients use the Service’s stable DNS name rather than a Pod IP address that can change when the Pod is replaced. section 3.2.6
- Selectors help constrain which nodes can run a workload. Tolerations and affinity or anti-affinity rules are other scheduling controls. section 3.0 section 3.5
Selecting application Pods
Assign a label such as `app:frontend-webserver` to application resources, then use a matching selector to identify the intended Pods for a Service. The selected targets form a dynamic group as matching resources change. section 3.2.6






