Label selector
A label selector is a Kubernetes expression that identifies or filters resources whose labels match specified keys, values, or conditions.
Kubernetes in Action, Second Edition
A label selector is a Kubernetes query expression that filters objects by label values or by the presence or absence of label keys.
- How it is used
- Filters labeled objects for kubectl operations and identifies pods or nodes used by Kubernetes objects.
- How deep it goes
- Works through equality, set membership, key presence, combined requirements, commands, and manifest uses; does not detail selector evaluation internals.
- Examples
- Uses pod-listing and deletion commands, a nodeSelector Pod manifest, Service backends, and ReplicaSet pod replacement.
- What you can do after
- Apply it via kubectl or manifests to target labeled objects, choose eligible nodes, and understand Service or ReplicaSet membership.
Read how Kubernetes in Action, Second Edition explains label selector →
Kubernetes for Developers
A label selector field is a Kubernetes resource field that identifies matching objects according to their labels.
- How it is used
- Identifies labeled Pods for Deployment management, Service traffic, and targeted status checks.
- How deep it goes
- Explains matching labels through Deployment and Service YAML and a kubectl query, without detailing selector internals.
- Examples
- Uses a timeserver Deployment and Service sharing a Pod label, a filtered kubectl query, and a blue/green traffic switch.
- What you can do after
- Operate/configure it in Kubernetes YAML, query matching Pods with kubectl, and switch Service traffic between labeled versions.
Read how Kubernetes for Developers explains label selector →
Google Anthos in Action
A Kubernetes selector is a label-based condition for identifying resources or choosing eligible nodes or workloads.
- How it is used
- Uses label-based matching to link Services to Pods and to constrain workload placement on nodes.
- How deep it goes
- Defines labels and selectors and explains dynamic grouping and Service linkage, but does not provide selector configuration syntax.
- Examples
- Uses `app:frontend-webserver` and `lob=sales` as label examples and a Service selecting application Pods as the linking scenario.
- What you can do after
- Apply label selectors to identify Service targets or help control which nodes run specific workloads.
Road to Kubernetes
A label selector is a Kubernetes matching expression that identifies or filters resources by their key-value labels.
- How it is used
- Identifies labeled resources for kubectl queries, Service traffic routing, and Deployment Pod management.
- How deep it goes
- Shows key-value matching in kubectl and Services and `matchLabels` in Deployments; leaves other selector-expression forms unexplored.
- Examples
- Uses an NGINX Service and 15-replica Deployment sharing `app: my-nginx`.
- What you can do after
- Operate/configure selectors to filter resources, connect a Service to labeled Pods, and match a Deployment to its Pod template.
Learn Docker in a Month of Lunches, Second Edition
A Kubernetes label selector is a query that identifies resources whose labels match specified criteria.
- How it is used
- Connects Services to destination Pods and Deployments to the Pods they manage.
- How deep it goes
- Explains matching, traffic outcomes, endpoints, and management relationships, but does not detail advanced selector expressions.
- Examples
- Uses numbers-api labels, kubectl selector queries, Service YAML, Deployment YAML, scaling, endpoint inspection, and request testing.
- What you can do after
- Apply it via kubectl and Kubernetes YAML to select Pods, verify matches, inspect endpoints, and route requests.
Read how Learn Docker in a Month of Lunches, Second Edition explains label selector →
Acing the Certified Kubernetes Administrator Exam, Second Edition
A label selector is a Kubernetes matching expression that identifies or associates objects by their labels.
- How it is used
- Connects Services to labeled pods and influences pod placement through node labels.
- How deep it goes
- Explains selector behavior through YAML examples and troubleshooting, stopping short of selector expression syntax beyond label equality.
- Examples
- Uses Service YAML, app=nginx labels, kubectl output, missing endpoints, and curl verification.
- What you can do after
- Diagnoses Service reachability with kubectl by comparing selectors, pod labels, endpoints, and port configuration.
Read how Acing the Certified Kubernetes Administrator Exam, Second Edition explains label selector →
gRPC Microservices in Go
A Kubernetes selector is a field or matching expression that identifies resources, such as Pods, according to their labels or other selection criteria.
- How it is used
- Routes Service traffic to matching Pods in internal or public deployment paths.
- How deep it goes
- Defines Service–Pod matching and shared selectors for canary rollout, without detailing selector-expression syntax.
- Examples
- Uses payment and order Services plus v1 and v2 canary Deployments sharing a selector.
- What you can do after
- Apply it via Kubernetes YAML to route Service requests to labeled Pods and support staged rollout.
Related concepts
- labeluses · A Kubernetes label is a key-value metadata pair attached to an object for identification, organization, querying, and selection.
- equality-based label selectorincludes · An equality-based label selector filters objects by requiring a label value to equal or not equal a specified value.
- set-based label selectorincludes · A set-based label selector filters objects by testing label values or label-key presence against specified sets or existence conditions.
- serviceused by · A Kubernetes Service is an API resource that provides stable network access and service discovery for a changing set of Pods or other specified destinations.
- poduses · A Kubernetes Pod is the smallest deployable unit in Kubernetes, grouping one or more co-located containers that share networking and other resources.
- Kubernetes controllerused by · A Kubernetes controller is a control-loop component that observes resource state and takes action to move actual state toward desired state.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






