In this lesson, you will learn how a service mesh automates service discovery by abstracting endpoint management away from manual DNS configuration.
The Problem with Traditional DNS
In standard Kubernetes, when Service A wants to talk to Service B, it relies on the CoreDNS service to resolve a cluster IP. If you need to manage cross-namespace traffic or handle complex load balancing, you often find yourself manually tweaking Kubernetes Endpoints or managing custom DNS records. This becomes a bottleneck as your architecture scales.
Discovery via the Mesh Control Plane
A service mesh, such as Istio, shifts the discovery responsibility from the infrastructure DNS to a centralized Control Plane. Once you inject a sidecar (the Envoy proxy) into your pods, the control plane constantly watches the API server for new deployments.
Instead of your application querying DNS, the sidecar maintains a local, up-to-date registry of every available service instance in the mesh. When your application sends a request to a hostname like order-service.production.svc.cluster.local, the sidecar intercepts this call and routes it directly to a healthy pod IP in the destination namespace.
How it looks in practice
Because the mesh handles discovery internally, you don't need to define Endpoints objects manually. You simply define a standard Kubernetes Service:
apiVersion: v1
kind: Service
metadata:
name: order-service
namespace: shop-production
spec:
ports:
- port: 80
selector:
app: orders
When you deploy this, the control plane instantly pushes the endpoint list (IPs of all pods with label app: orders) to every other sidecar in the mesh. Your services can now discover each other across namespaces automatically, regardless of the underlying network topology. The sidecar ensures that load balancing occurs at the application layer, providing faster, more reliable communication than traditional round-robin DNS. By decoupling the discovery process from the cluster's native networking, you eliminate the overhead of DNS propagation delays and manual endpoint tracking.
Key Takeaway: Service mesh replaces manual DNS and endpoint management with a dynamic, sidecar-based registry that automatically synchronizes service locations across your entire cluster.