Service Mesh
Add mTLS, traffic shaping and consistent telemetry between services without changing application code.
Advanced · about 8 hours · difficulty 4/5
Learn first: Services, Ingress and Network Policy, TLS and Certificates
A service mesh moves cross-cutting network concerns out of application code and into infrastructure. Proxies (sidecars such as Envoy, or node-level proxies in newer "ambient" designs) handle traffic between services, managed by a control plane.
What a mesh gives you
- Mutual TLS between services with automatic certificate rotation, plus identity-based authorisation policies.
- Traffic management: retries, timeouts, circuit breaking, traffic splitting for canaries, and fault injection.
- Uniform telemetry: request rates, errors and latencies for every service-to-service call, plus trace propagation.
Options
- Istio: most feature-rich; sidecar and ambient modes.
- Linkerd: simpler, lightweight, strong defaults.
- Cilium service mesh (eBPF based) and Consul are other choices.
When it is worth it
Many services, strict zero-trust requirements, or advanced progressive delivery. For a handful of services, the operational overhead (extra latency, memory, upgrades, debugging another layer) often outweighs the benefit.
Good enough to move on: you can install a mesh on a test cluster, enable mTLS for a namespace, and split traffic 90/10 between two versions of a service.
Key concepts
- Sidecar vs ambient data planes
- mTLS and service identity
- Retries, timeouts, circuit breaking
- Traffic splitting
- Istio
- Linkerd
- Cilium service mesh
Mini project
Install Linkerd or Istio on a kind cluster with a two-service demo app, enable strict mTLS, and shift 10% of traffic to a v2 deployment while watching the golden metrics.
Check yourself
What costs does a service mesh add, and at what point would you decide those costs are worth paying?
Free resources
- Istio documentation (istio.io)
- Linkerd documentation (linkerd.io)