In a large application made of microservices, every call to a neighbour can fail, slow down or be intercepted. A service mesh is an infrastructure layer that takes these tasks on itself: a proxy runs next to each service, and a shared control layer sets the rules for all the proxies. The application code stays unchanged.
How it is structured
The proxy next to a service is called a sidecar: sidecars are deployed together with the application, and all traffic between the services goes through them. The set of sidecar proxies is the data plane, and the services that hand them configuration and certificates are the control plane. Istio can also work without sidecars: in ambient mode a shared proxy sits on every node of the cluster rather than in every pod.
| Plane | What it does |
|---|---|
| Data | the sidecar proxies (Envoy in Istio, Linkerd’s own proxy written in Rust) intercept all incoming and outgoing traffic of a pod and apply the rules |
| Control | keeps track of the services and hands the proxies configuration and certificates |
What it takes over
- mutual authentication and encryption of traffic between services over mTLS — certificates are issued and renewed automatically;
- retries, timeouts and circuit breaking on failures;
- routing by version: for example, sending 5% of traffic to a new version for a canary release;
- metrics, logs and tracing of every call — the proxies collect them and send them to monitoring systems;
- access control: which service may call which, decided by workload identity rather than by IP address.
An example with Istio
apiVersion: networking.istio.io/v1kind: DestinationRulemetadata: name: paymentsspec: host: payments trafficPolicy: tls: mode: ISTIO_MUTUAL # mTLS between services connectionPool: http: h2UpgradePolicy: UPGRADEAfter Istio is installed into a Kubernetes cluster, a call between pods passes through two Envoy sidecar proxies — on the sender and on the receiver. The proxies enforce mTLS, collect telemetry and decide afresh each time which pod to hand the request to. Istiod acts as the certificate authority and issues the certificates, so encryption is switched on without any manual key distribution.
When a mesh is needed and when it is not
A mesh pays off most when there are many services and different teams are losing track of how they interact: regulatory requirements for encryption inside the perimeter appear, and unified telemetry is needed. For a dozen services owned by a single team it is cheaper to make do with libraries and Kubernetes settings — a proxy in every pod consumes memory and adds latency to every call.
Sources
the term is written from these pagesVerified 8 Nov