Service Mesh
A service mesh is a dedicated infrastructure layer that manages service-to-service communication in a microservices system, adding security, observability, and reliability without changing application code. It does this with proxies that sit alongside or beside workloads.
What a mesh provides
- Security: automatic mTLS and identity-based authorization between services.
- Observability: per-service latency, error rate, and traffic metrics, plus tracing.
- Reliability: retries, timeouts, and circuit breaking applied uniformly.
- Traffic control: weighted routing, canary releases, and header-based routing.
istiod"] -->|"config and certs"| A["Pod A
app + proxy"] C -->|"config and certs"| B["Pod B
app + proxy"] A <-->|"mTLS traffic"| B classDef ctl fill:#8B5CF6,color:#ffffff classDef pod fill:#DBEAFE,color:#1E293B class C ctl class A,B pod
Data plane and control plane
- The data plane is the set of proxies handling real traffic. In the classic model these are sidecars injected into pods. Istio's ambient mode uses shared per-node and optional per-namespace proxies instead.
- The control plane distributes configuration and issues certificates, and never sees request traffic.
Istio vs Linkerd
| Aspect | Istio | Linkerd |
|---|---|---|
| Proxy | Envoy | Rust micro-proxy |
| Feature set | Very broad | Focused |
| Overhead | Higher | Lower |
When to adopt one
A mesh is worth it when you have many services, need mTLS for compliance, want safe canary traffic control, or need uniform telemetry. For a handful of services it is often over-engineering, and an ingress controller plus app-level retries covers most needs.
Quick troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Calls fail after enabling the mesh | Sidecar not injected | Check namespace label, restart pods |
| mTLS errors | Mixed meshed and unmeshed pods | Use PERMISSIVE during migration |
| Canary weights ignored | DestinationRule subsets missing | Define subsets first |
RememberA mesh handles east-west (service-to-service) traffic. It does not replace Ingress, Kubernetes Services, or business logic.
SecuritymTLS is not a substitute for NetworkPolicy. Use both for isolation on multi-tenant clusters.
Common MistakeInstalling a mesh without budgeting proxy CPU and memory, which can force unplanned node scale-up.
Frequently Asked Questions
What does a service mesh solve that a load balancer does not?
A load balancer handles north-south traffic into the cluster. A mesh manages the many east-west calls between services, giving consistent mTLS, retries, timeouts, and telemetry for every pair.
When should a team not adopt a mesh?
With a small number of services or limited Kubernetes operational maturity. The added proxies, latency, and debugging complexity may outweigh the benefit.
What is sidecarless or ambient mode?
A mesh design that moves proxy functions to shared per-node components so pods do not each carry a sidecar, reducing overhead.