Comparison
Headless servicevsLayer 4 load balancing
Headless service
the name resolves to every instance's own address instead of one virtual one, because the client wants to choose.
A service with no virtual address, whose DNS record returns the individual backend addresses. It exists for clients that need to address members directly — database replicas, brokers, anything doing its own connection pooling or its own load balancing. It is also the standard fix for a gRPC or HTTP/2 client whose single long-lived connection would otherwise pin itself to one backend forever.
Full entry →Layer 4 load balancing
the balancer picks a backend per TCP connection and never looks inside, so it cannot route on a path or retry a request.
Distributing traffic by connection at the transport layer, without parsing what is being carried. It is fast, protocol-agnostic and cheap, and it is blind: no path-based routing, no header inspection, no per-request retry, and no rebalancing of a connection once established. That last property is why one long-lived multiplexed connection sends every request to a single backend regardless of load.
Full entry →