Covers service meshes: data plane versus control plane, Envoy as a proxy, Istio sidecar and ambient (ztunnel and waypoint) modes, Linkerd's Rust micro-proxy, automatic mTLS, retries and traffic splitting, golden-signal metrics, operational cost, and alternatives such as Container Apps or plain Kubernetes.
A service mesh moves service-to-service concerns out of code into the platform. A data plane of proxies intercepts every call, and a control plane configures them and issues certificates. You get automatic mTLS with workload identity, traffic management (retries, timeouts, weighted canaries, per-request gRPC balancing) and golden metrics per edge.
ztunnel for L4 mTLS and optional waypoint proxies for L7.The trade-off is operational: extra latency and memory per pod, a control plane to upgrade, and harder debugging. Under roughly ten services, the platform's built-in features are usually enough.
"A service mesh puts a proxy on every network hop between services and a control plane that programs those proxies. The point is that cross-cutting network behaviour, encryption, identity, retries, traffic splitting and metrics, becomes platform configuration instead of code in every service. Envoy is the proxy underneath most of it. Istio historically injected an Envoy sidecar into each pod; its ambient mode, which went GA in Istio 1.24, replaces that with a per-node
ztunnelthat does mTLS at layer 4, and you add a waypoint proxy only for services that need layer 7 features like header-based routing. Linkerd takes the opposite approach: a tiny Rust micro-proxy sidecar, opinionated defaults, very little to configure.For a .NET team the concrete wins are three. First, mTLS everywhere with short-lived certificates and no code change, which helps with zero-trust and Essential Eight conversations. Second, traffic control: I can shift 5% of traffic to a new version with a
VirtualServiceor an HTTPRoute, and gRPC gets per-request load balancing so one HTTP/2 connection does not pin to one pod. Third, uniform request, error and latency metrics for every edge, which fills gaps for services nobody instrumented well.The mistake I see is installing Istio for five services because it is on a reference architecture. Then you have hundreds of megabytes of sidecars, upgrades every few months, and engineers who cannot tell whether a 503 came from their code or Envoy. I also see teams double up retries in Polly and the mesh. A mesh earns its keep at scale or under a hard mTLS requirement; before that, Container Apps' built-in features or plain Kubernetes with good app telemetry are cheaper."
| Istio (sidecar) | Istio (ambient) | Linkerd | Envoy alone | |
|---|---|---|---|---|
| Data plane | Envoy per pod | ztunnel per node (L4) + optional waypoint (L7) | Rust micro-proxy per pod | You deploy and configure it |
| mTLS | Yes | Yes (ztunnel) | Yes, on by default | Manual |
| L7 routing, canaries | Rich | Via waypoint | Basic (HTTPRoute) | Rich, hand-written |
| Resource cost | Highest | Lower (no per-pod proxy) | Low | Depends |
| Operating effort | High | Medium-high | Lower | High |
| On AKS | Istio-based service mesh add-on (managed) | Check add-on support before choosing | Self-installed | Gateways, ingress |
| The mesh gives you | You still own in the app |
|---|---|
| Transport encryption and workload identity | Authorisation (app roles, policies) |
| Retries and timeouts per route | Idempotency, so retries are safe |
| Edge metrics and access logs | Business metrics and spans inside the service |
| Traffic splitting | Backwards-compatible contracts between versions |
On an AKS cluster with [40] .NET services, enabling the Istio add-on gave mTLS on every hop for a [Privacy Act] audit without touching code. Envoy sidecars added about [0.5-1 ms] at p50 and [60-80 MB] of memory per pod, which we accepted; we turned off mesh retries where Polly already retried.
Checks whether the candidate understands how a mesh works and can weigh its benefits against a real operational cost.
Green flags
Red flags
control plane (istiod / linkerd-destination + identity)
| config (xDS) | certificates (SPIFFE identities)
v v
[orders pod: app -> proxy] ==mTLS==> [proxy -> pricing pod: app]
\_ metrics, access logs, traces headers _/
Traffic is redirected into the proxy by iptables rules (or eBPF/CNI) so the app keeps calling http://pricing. The proxy upgrades the hop to mTLS, applies routing and retry rules, and emits metrics.
Sidecars mean one proxy per pod: memory scales with replica count, and upgrading the mesh means restarting every pod. Ambient mode splits the work:
node: [ztunnel] <- L4: mTLS, identity, L4 authorisation, telemetry for all pods on the node
per service/namespace (optional): [waypoint Envoy] <- L7: HTTP routing, retries, header-based policy
Ambient went GA in Istio 1.24 (late 2024) and recent releases keep adding features, such as weighted waypoint canaries in 1.31. Check that your managed offering (for example the AKS Istio add-on) supports the mode before you design around it.
Each workload gets an X.509 certificate encoding a SPIFFE id such as spiffe://cluster.local/ns/shop/sa/orders, tied to its Kubernetes service account. Certificates are short-lived (hours) and rotated automatically. PeerAuthentication in STRICT mode rejects plaintext; AuthorizationPolicy can allow orders to call pricing only. That is coarse service-level authorisation; per-user and per-record rules stay in the app.
v1 and v2 subsets for canaries.Proxies report request count, error rate and latency histograms per source and destination (Prometheus), plus access logs. They can start spans, but the app must forward traceparent for traces to join, which .NET's HttpClient and OpenTelemetry already do.
| Cost | Rough size |
|---|---|
| Sidecar memory | Tens of MB per pod (Envoy usually more than Linkerd's proxy) |
| Latency | Sub-millisecond to a few ms per hop at p99 |
| Upgrades | Control plane plus data plane, every few months to stay supported |
| Skills | xDS, Envoy config dumps, istioctl analyze, mesh-specific CRDs |
A sidecar also changes pod lifecycle: if the proxy exits before the app finishes draining on SIGTERM, in-flight outbound calls fail. Native sidecar containers in Kubernetes and ambient mode reduce that.
linkerd viz stat deploy to see golden metrics without code changes.istioctl ztunnel-config workloads.The .NET code does not change for a mesh; what matters is that the service propagates trace context and does not double up retries. The traffic split lives in Kubernetes config.
// Program.cs: in a mesh, keep timeouts in the app but let the mesh own retries for this client.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetry()
.WithTracing(t => t.AddAspNetCoreInstrumentation().AddHttpClientInstrumentation().AddOtlpExporter());
builder.Services.AddHttpClient<PricingClient>(c =>
{
c.BaseAddress = new Uri("http://pricing.shop.svc.cluster.local"); // plain HTTP: the mesh upgrades it to mTLS
c.Timeout = TimeSpan.FromSeconds(3); // the app still bounds its own wait
});
// No AddStandardResilienceHandler here because the mesh route below retries; pick one layer.
var app = builder.Build();
app.MapGet("/quote/{sku}", async (string sku, PricingClient pricing, CancellationToken ct) =>
Results.Ok(await pricing.GetAsync(sku, ct)));
app.Run();
public sealed class PricingClient(HttpClient http)
{
public Task<decimal> GetAsync(string sku, CancellationToken ct) =>
http.GetFromJsonAsync<decimal>($"/prices/{Uri.EscapeDataString(sku)}", ct);
}
# Gateway API HTTPRoute: 90/10 canary for pricing, supported by Istio and Linkerd
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: { name: pricing, namespace: shop }
spec:
parentRefs: [ { group: "", kind: Service, name: pricing, port: 80 } ]
rules:
- backendRefs:
- { name: pricing-v1, port: 80, weight: 90 }
- { name: pricing-v2, port: 80, weight: 10 }
traceparent. Instead: Keep OpenTelemetry in the .NET service.terminationGracePeriodSeconds alone does not fix the order. Instead: Use Kubernetes native sidecar containers (an init container with restartPolicy: Always, which Kubernetes starts before and stops after the app; supported by recent Istio and Linkerd versions), or the mesh's proxy drain settings, or ambient mode, which has no per-pod proxy.A mesh is a platform-team product, not a library. The question to ask is which problem justifies it: regulatory mTLS everywhere, canary releases across dozens of services, or uniform telemetry for teams that will not instrument. If none of those is pressing, the cheaper answer is Container Apps or plain Kubernetes, managed identity tokens between services and OpenTelemetry in the app. When you do adopt one, ambient mode or a managed add-on reduces the per-pod cost and the upgrade blast radius.
The overhead grows with scale in ways teams underestimate. Sidecar memory is paid per replica, so [400] pods at [70 MB] each is about 28 GB of cluster memory, which on AKS can mean extra nodes and a visible line on the Azure bill. The control plane pushes config to every proxy, so a large mesh needs config scoping (Sidecar resources or namespace boundaries) or istiod CPU and proxy memory climb. Every incident gains a new suspect, so on-call engineers need to read Envoy access logs (response_flags such as UF or UH) and use istioctl analyze. A managed add-on, such as the Istio-based service mesh add-on for AKS, takes control-plane upgrades and certificates off your hands, but you still own data-plane restarts, the policy CRDs and the debugging skills, and you are limited to the versions and modes it supports.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Istio sidecar | Rich L7 policy, many teams, mature platform team | Highest resources and complexity | Small clusters, no platform team |
| Istio ambient | Want mTLS everywhere with less overhead, L7 only for some services | Newer; check managed support | Need every L7 feature on every hop today |
| Linkerd | Simple mTLS and metrics, small team | Fewer features; check current licensing for stable builds | Need extensive L7 routing |
| No mesh | Under ~10 services, Container Apps | You implement mTLS and identity through the platform or tokens | Hard requirement for uniform mTLS and canaries |
Measure the overhead in your own cluster before rolling out widely: p99 latency per hop, proxy memory and CPU per pod, node count and monthly cost, and mean time to diagnose a deliberately injected fault, before and after enabling it on one namespace.
There are three styles. HTTP/JSON is universal and easy to debug; in .NET use IHttpClientFactory with AddStandardResilienceHandler for timeouts, retries and a circuit breaker. gRPC gives strict Protobuf contracts, smaller payloads, streaming and deadlines over HTTP/2, which suits high-volume internal calls, but needs layer 7 load balancing. Messaging (Azure Service Bus) removes temporal coupling: the receiver can be down or slow and the work still completes, at the cost of eventual consistency and idempotent consumers.
I choose per interaction: if the caller needs an answer to continue, call synchronously; if it is a command or an event that can finish later, send a message. For security, each service authenticates with managed identity to get an Entra ID token the callee validates, and mTLS from a mesh or platform encrypts the hop. The trade-off: every synchronous hop multiplies latency and failure.
Treat it as three separate problems. Protocol failures ("protocol error", Unavailable, missing grpc-status) mean HTTP/2 isn't working end to end: a proxy downgrades to HTTP/1.1, drops trailers, or the endpoint isn't configured for HTTP/2 (plain-text HTTP/2 needs Http2-only endpoints; TLS needs ALPN). One pod gets all the traffic because a layer 4 load balancer pins each long-lived HTTP/2 connection to one backend; the fix is layer 7 balancing, a service mesh, or client-side round robin. DeadlineExceeded under load is usually queuing, not slowness: the 100-stream limit per connection, ThreadPool starvation, or deadlines stacked per hop instead of propagated. I diagnose with gRPC client and server logs at Debug, grpcurl from inside the network, Application Insights dependency timings and the gRPC EventCounters.
The trade-off: long-lived HTTP/2 connections are efficient, but they move load balancing and timeouts into your design.
When a pod is stopped, Kubernetes removes it from Service endpoints and sends SIGTERM at the same time, then waits terminationGracePeriodSeconds (30 s by default) before SIGKILL. In .NET the Generic Host turns SIGTERM into IHostApplicationLifetime.ApplicationStopping; Kestrel stops accepting new connections and drains in-flight requests, and every IHostedService.StopAsync runs, all bounded by HostOptions.ShutdownTimeout (30 s by default since .NET 6, including .NET 10; it was 5 s before). Because endpoint removal propagates slowly, add a short preStop delay so the pod keeps serving until load balancers stop sending to it.
On the way up, a startup probe covers slow initialisation, a readiness probe decides whether the pod gets traffic, and liveness restarts only a truly stuck process. The trade-off: longer grace periods mean safer drains but slower deploys and scale-in.
How to tell it (STAR)
**S:** After we turned on Istio for mTLS across [25] services, every deployment caused a short spike of 503s. **T:** I had to stop deployments hurting customers without backing out the mesh. **A:** I lined up pod termination events with Envoy access logs and saw the proxy shutting down before the .NET app finished draining. I made the proxy start before and stop after the app, added a preStop delay, and added a load test during rollouts to the pipeline. **R:** Deployment errors went from [about 2%] to [zero] over the next [30] releases, and we kept mTLS.
Last updated 23 Nov 2026.