Service meshes
What a service mesh adds: mutual TLS with workload identity, L7 traffic control and metrics, sidecar versus ambient data planes, and when it's worth it.
Network policiesThe Gateway APIInit containers and sidecar containers
Service meshes
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- A mesh moves service-to-service concerns out of app code into proxies: mutual TLS with workload identities, retries, timeouts, traffic splitting, and per-request metrics and traces.
- The control plane (istiod, Linkerd's control plane) hands each proxy its config and a short-lived certificate tied to the Pod's service account, often as a SPIFFE ID.
- Sidecar meshes add a proxy to every Pod. Native sidecar containers (GA in 1.33) finally start them before the app and stop them after it.
- Ambient-style meshes (Istio ambient, GA since Istio 1.24) use a per-node L4 proxy for mTLS and add L7 waypoint proxies only where needed, cutting per-Pod overhead.
- Meshes increasingly take their routing config as Gateway API HTTPRoutes attached to a Service (GAMMA). A mesh costs CPU, memory, latency and operational skill, so adopt it for a concrete need.
The same code in every service
Put fifty services in a cluster and the same requirements show up in each one. Encrypt traffic between services. Prove that the caller really is the checkout service. Retry a failed call, but not forever. Time out slow calls. Shift 5 percent of traffic to a new version. Emit request rates, error rates and latencies for every hop. You can put all of that into a shared library, but then you need that library in Go, Java, Python and Node, kept in sync and upgraded in every service.
A service mesh moves those concerns out of the app into a proxy that sits on the path of every request. The app speaks plain HTTP to localhost or to a Service name. The proxy does the TLS, identity, retries, routing and telemetry. The system design lesson on sidecars and meshes covers the pattern in general. This lesson is about how it lands on Kubernetes.
Control plane and data plane
Every mesh has two halves. The data plane is the proxies: Envoy for Istio and Cilium, Linkerd’s own small Rust proxy. The control plane (istiod for Istio) watches the Kubernetes API, Services, EndpointSlices and the mesh’s own config, and pushes routes, endpoints and policy to every proxy.
It also acts as a certificate authority. Each workload gets a short-lived certificate whose identity comes from its Kubernetes service account, typically as a SPIFFE ID such as spiffe://cluster.local/ns/shop/sa/web. The workload proves who it is with its projected service account token. Proxies then do mutual TLS on every connection: both ends present certificates, so the server knows the caller’s identity, not just its IP. That’s the difference from a NetworkPolicy: policy can say “only the web service account may POST /orders on api”, traffic is encrypted, and none of it depends on Pod IPs.
Sidecars, and the ordering problem
The classic data plane is a sidecar: a mutating admission webhook injects a proxy container into every Pod in labelled namespaces, and an init container (or a CNI plugin) rewrites the Pod’s iptables so all traffic passes through it. Think of it as a personal interpreter assigned to every employee.
For years, sidecars were ordinary containers, which caused real bugs. The app could start before the proxy was ready and fail its first calls. At shutdown the proxy could exit first and drop in-flight requests. And a Job never completed, because the proxy never exits. Native sidecar containers, GA in Kubernetes 1.33, fix this: an init container with restartPolicy: Always starts before the app containers, keeps running alongside them, and is stopped after they exit.
spec:
initContainers:
- name: proxy
image: envoyproxy/envoy:v1.36
restartPolicy: Always
containers:
- name: app
image: nginx:1.29
The API server accepted that Pod in the lab and kept restartPolicy: Always on the init container. The sidecar containers lesson covers the lifecycle in detail. Istio and Linkerd can both inject their proxies as native sidecars.
Ambient: proxies per node, not per Pod
A proxy in every Pod has a cost: memory and CPU multiplied by thousands of Pods, and a rolling restart of every workload to upgrade the proxy. Istio ambient mode, GA since Istio 1.24 in November 2024, splits the work in two. A per-node ztunnel (a DaemonSet) captures traffic and provides L4 features: mTLS, identity, L4 authorization and telemetry. When a namespace or service needs L7 features (HTTP routing, retries, per-path policy), you deploy a waypoint proxy for it, and only that traffic goes through Envoy. Back to the interpreter analogy: one interpreter per floor for everyone, plus a specialist for the teams that need one.
Cilium takes a similar line with an eBPF dataplane and a per-node Envoy. The trade-offs are newer code paths and a node-level component whose failure affects every Pod on the node.
Routing with the Gateway API
Meshes used to need their own routing CRDs (Istio’s VirtualService, Linkerd’s ServiceProfile). The Gateway API’s GAMMA work lets a mesh take ordinary HTTPRoutes whose parent is a Service instead of a Gateway:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: {name: api-mesh, namespace: shop}
spec:
parentRefs: [{group: "", kind: Service, name: api, port: 80}]
rules:
- backendRefs:
- {name: api, port: 80, weight: 95}
- {name: api-v2, port: 80, weight: 5}
timeouts: {request: 2s}
That’s a 95/5 canary and a 2-second timeout for every in-mesh call to api, in the same API you use at the edge. It applied cleanly in the lab against the v1.7 CRDs, but with no mesh, nothing acted on it. Istio, Linkerd and Cilium all implement this mesh profile to varying degrees.
Is it worth it?
A mesh is real infrastructure. It adds latency at each hop (typically a millisecond or so per proxy), CPU and memory, a control plane to upgrade, and a new class of failures when certificates or config pushes go wrong. Retries in both the mesh and the app multiply. Good reasons to adopt one are a requirement for encryption and identity between services (compliance, zero trust), many services in several languages needing consistent traffic control, or canary releases at the request level. “We might need it someday” isn’t one. Linkerd is the smaller, simpler option, though since 2024 its open-source project publishes only edge releases, with stable builds from Buoyant. Istio is the most featureful, and its ambient mode lowers the cost of entry.
About the video
The embed is TechWorld with Nana’s “Istio & Service Mesh - simply explained in 15 mins”, January 2021, 16 minutes. Its chapters cover the challenges of a microservice architecture, the sidecar pattern, traffic splitting, Istio’s architecture and configuration, its discovery, security, metrics and tracing features, the Istio gateway, and a final traffic-flow overview. The concepts hold up, but it’s from 2021: it shows only sidecars, uses Istio’s own routing CRDs, and predates ambient mode, native sidecars and the Gateway API mesh work. Solo.io’s 2025 video in deeper covers ambient mode, from a company that sells Istio products. Both were judged from chapters and descriptions, since transcripts can’t be fetched here. Neither carries an audio-track flag, and both have English caption tracks.
What was run: against a local v1.37.3 API server, we applied a Pod with a native sidecar and the GAMMA HTTPRoute above against Gateway API v1.7.0 CRDs. No mesh was installed and no traffic flowed. Mesh behaviour is from the Istio, Linkerd and Kubernetes sidecar docs, checked 2026-11-28.
Where this fits
That ends networking. Next comes the data that has to outlive the Pods. Next: volumes and ephemeral storage.
Check yourself
How does a mesh's mTLS differ from a NetworkPolicy that only allows web to talk to api?
NetworkPolicy works on IPs and ports at L3 and L4 and doesn't encrypt. A mesh encrypts each connection and authenticates both ends by a cryptographic identity derived from the service account, so policy can say the api accepts only the web service account, regardless of IPs, and can go down to HTTP methods and paths.
Before native sidecars, Jobs with an injected proxy often never completed. Why, and what fixed it?
The proxy was an ordinary container that never exits, so the Pod stayed Running after the job's main container finished. Native sidecars (init containers with restartPolicy Always) are stopped by the kubelet once the main containers exit, and they start before them, so the app doesn't start without its proxy.
Why might a team choose ambient mode over sidecars?
No proxy per Pod: less memory and CPU across thousands of Pods, no restart of workloads to inject or upgrade the proxy, and L4 mTLS for everything with L7 waypoints only for services that need HTTP policy or routing.
A mesh adds retries. What can go wrong if the app also retries?
Retries multiply. Three app retries times three mesh retries is up to nine attempts per request at every hop, which can turn a slow dependency into an outage. Retry in one layer, on idempotent requests, with budgets.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.