CertGrid CertGrid
Troubleshooting·Certified Kubernetes Application Developer

Service Selectors and Endpoints

A Service whose selector matches nothing is completely valid. It gets a ClusterIP, it resolves in DNS, and it routes to nowhere - with no error, no event and no warning. This reproduces it, shows the two commands that identify it in seconds, and then covers the DNS names a Service gets and how a headless one differs.

Services and Networking Guide 34 of 44 Beginner

ndots:5 in the Pod's resolv.conf means any name with fewer than five dots is tried against every search domain first. That is why api resolves, why nslookup api prints NXDOMAIN lines for the suffixes it tries on the way, and why an external name like example.com costs several failed lookups before the real one.

A two-replica Deployment, two Services and a busybox client, all in one namespace.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when a Service exists, resolves, and answers nothing. This matters because a selector that matches nothing is completely valid - the object is accepted, DNS works, and the only sign of trouble is an empty endpoint list.

Before you start

  1. A Service with a typo in its selector

  2. The two commands that find it

  3. The names that resolve

  4. A headless Service returns something different

Official sources