In this article
Headless DNS exposes endpoint identity; the consumer must supply the routing and refresh behavior it needs.
A serving client switches from an ordinary Service to a headless Service and expects Kubernetes to distribute requests as before. DNS now returns individual worker addresses. The client has gained endpoint selection responsibility; resolving a name is no longer equivalent to reaching one virtual Service address.
Read the headless contract
A headless Service explicitly uses clusterIP set to None. Kubernetes does not allocate its usual virtual IP or provide ordinary platform proxy load balancing for it. With the supported selector arrangement, DNS publishes backend addresses. Leaving clusterIP unspecified is different from explicitly selecting the headless behavior.
Decide why identity is needed
Distributed workers may need to address a particular peer, and StatefulSet naming can provide stable identity. An independent inference replica client may instead need load distribution. Those are different requirements. Choosing a headless Service solely because it returns several addresses does not define a fair or health-aware request-routing algorithm.
Build endpoint selection deliberately
Determine how the client handles multiple DNS answers, address families and reconnects. Some libraries reuse one connection for many requests and therefore keep using one selected worker. Others cache the answer. The presence of several records does not prove requests reach every replica. Measure actual target identity under the intended connection-pool behavior.
Account for changing records
A recreated Pod can retain a stable name while obtaining a different address. DNS caches, including negative responses, affect when clients observe changes. Use documented resolver behavior and bounded reconnect handling. Do not hard-code the first observed Pod IP as permanent identity, or treat one successful lookup as a durable membership subscription.
Test selection and replacement
Use synthetic workers returning safe instance markers. Observe distribution and targeted peer selection, then replace one worker and inspect recovery. Verify the correct readiness publication policy for the audience. Acceptance means the client intentionally uses individual endpoints and survives supported changes. It does not promise platform load balancing, global completion ordering or a fixed DNS propagation delay for every cluster and resolver combination.
Primary references
Related reading: Slow DNS in a Pod: search domains and ndots; GPU networking and availability: beyond internet speed.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.