Cloud API Overview > @adpt/cloud > k8s > ServiceSpec > selector
k8s.ServiceSpec.selector property
Route service traffic to pods with label keys and values matching this selector.
Signature:
selector?: object;
Remarks
If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName.
For more information, see the Kubernetes documentation.