FullStack AI Hub
Studio
Cloud & Kubernetes · 02. Traffic & GitOps
9 min
6 steps
Intermediate

Ingress, Service Mesh & mTLS

Route north-south traffic via Gateway API, enforce zero-trust east-west mTLS with Envoy, and prevent retry storms.

Cloud & Kubernetes02. Traffic & GitOpsLesson 1 of 2
9 minIntermediate6 steps

Ingress, Service Mesh & mTLS

Route north-south traffic via Gateway API, enforce zero-trust east-west mTLS with Envoy, and prevent retry storms.

East-West TLS
None
Lateral Risk
High
L7 Telemetry
Manual
Hop Latency
3 ms
lateral HTTPExternal UsersIngress LBMarketingPodPayments Pod
North-South HTTPS
mTLS Handshake / Cert
East-West Mesh Traffic
Canary / Retry Burst
Denied Policy / 503
In This LessonStep 1 of 6
What You Will Master
  • ✓Terminate external TLS and route host/path traffic with Kubernetes Gateway API
  • ✓Automate short-lived SPIFFE mTLS certificates between microservices via a service mesh
  • ✓Shift 5% → 50% → 100% canary weights at Layer 7 without scaling pod counts
  • ✓Weigh Envoy sidecar CPU/memory overhead against ambient/eBPF mesh alternatives

Architectural Trade-Off Comparison Matrix

PatternBest ForKey Trade-Off
Gateway API (L7)Role-separated TLS termination, header routing, and weighted splitsHandles north-south entry only; internal hops stay unencrypted
Sidecar Service MeshAutomatic mTLS, per-route retries, and cross-language telemetryAdds an Envoy proxy per pod (~50 MB RAM, ~2 ms hop)
NetworkPolicy (L3/L4)Default-deny firewall rules restricting namespace communicationOperates on IPs/ports only—cannot inspect HTTP paths or JWTs
Ambient / eBPF MeshZero-trust mTLS without per-pod sidecar RAM tax at large scaleSplits L4 node tunnel from optional L7 waypoint proxies

Step-by-Step Architectural Breakdown (6 Steps)

Full architectural walkthrough transcript and state transitions for Ingress, Service Mesh & mTLS.

STEP 01 · PROBLEMJump to step →

Kubernetes Flat Network & East-West Exposure

By default in Kubernetes, every pod can reach every other pod in plaintext. One compromised low-privilege container can pivot straight into internal Payments services.

watch:Edge TLS alone does nothing once an attacker lands inside the cluster network.

Flat Pod NetworkLateral MovementPlaintext East-WestPerimeter Only
STEP 02 · SETUPJump to step →

Gateway API North-South L7 Routing

Kubernetes **Gateway API** separates cluster operator TLS (`Gateway`) from app routing (`HTTPRoute`), providing typed path matching, timeouts, and rate limits at the edge.

idea:Gateway API replaces brittle Ingress annotations with typed, portable Kubernetes resources.

Gateway APIHTTPRouteTLS TerminationNorth-South Traffic
STEP 03 · SOLUTIONJump to step →

Zero-Trust Service Mesh & Automatic mTLS

A service mesh mints short-lived **SPIFFE X.509 certificates** so Envoy proxies transparently enforce mutual TLS and L7 AuthorizationPolicies—allowing only Orders to call Payments.

good:App containers speak plain localhost while every cross-node wire packet is mTLS-encrypted.

Mutual TLSSPIFFE IdentityEnvoy SidecarAuthorizationPolicy
STEP 04 · TECHNIQUEJump to step →

L7 Canary Splits & Retry Budgets

Envoy shifts exact **95/5 canary percentages** at L7 independent of replica count, while enforcing **retry budgets** (≤20%) and outlier ejection so broken canary pods never cause retry storms.

watch:Unbounded retries across a 4-hop microservice tree amplify load 81× during a brownout.

Weighted CanaryOutlier EjectionRetry BudgetL7 Load Balancing
STEP 05 · TRADE-OFFJump to step →

Sidecar Tax vs Ambient / eBPF Mesh

Per-pod sidecars consume ~50 MB RAM each (250 GB across 5,000 pods). **Ambient / eBPF meshes** consolidate L4 mTLS into a shared per-node agent (`ztunnel`), cutting memory overhead 80%.

idea:Start with Gateway API + NetworkPolicies; adopt a mesh when cross-service mTLS or L7 telemetry justifies the ops footprint.

Sidecar OverheadAmbient MesheBPF DataplaneWaypoint Proxy
STEP 06 · RECAPJump to step →

Cluster Traffic & Zero-Trust Mesh Recap

Combine **Gateway API** at the perimeter, **default-deny NetworkPolicies**, and **SPIFFE mTLS + retry budgets** inside the cluster for resilient zero-trust traffic management.

good:Zero-trust inside Kubernetes ties identity to cryptographic certificates, never mutable pod IPs.

Zero-Trust MeshGateway APIRetry BudgetsSPIFFE

Related Production Deep-Dives & Simulators

Related Systems Course
Free · Verifiable Credential

FS-201Production LLM Engineer

Design an observable full-stack LLM product from capability validation through interfaces retrieval evaluation security and operations.

37 concepts~35h self-paced
Start Free Course
Weekly Engineering Dispatch

Get the weekly systems teardown

One technical note per week covering inference bottlenecks, retrieval harnesses, and commit-pinned teardowns.