envoy-guide
Module 5 · Envoy as a Sidecar·18 min·advanced

From static config to xDS and Istio

See how Istio generates the same config you've been writing by hand.

What changes when you scale past one Envoy

Everything you've written so far has been static config — one YAML file, loaded at boot, frozen until you restart. That's perfect for one Envoy. It is not perfect for 500 Envoys spread across 30 services.

At fleet scale, you need:

  • Config changes that propagate without restarts.
  • A single source of truth (your service catalog, your routing rules).
  • Atomic-feeling updates: a new cluster's endpoints arrive before a route that uses it.

That is exactly what xDS is for.

xDS in five letters

xDS is an umbrella name for a family of gRPC APIs Envoy uses to fetch config dynamically. Each member delivers one kind of resource:

APIResource it deliversMaps to your YAML
LDS — Listener DiscoveryListenersstatic_resources.listeners
RDS — Route DiscoveryRoute configsroute_config inside HCMs
CDS — Cluster DiscoveryCluster definitionsstatic_resources.clusters
EDS — Endpoint DiscoveryEndpoints inside a clusterload_assignment
SDS — Secret DiscoveryTLS certs and keystls_certificates
ADS — Aggregated DiscoveryAll of the above on one ordered stream(the umbrella)

Each is just a gRPC streaming RPC. Envoy connects to a control plane and says "tell me about your listeners" (LDS), "tell me about cluster X's endpoints" (EDS), and so on. The control plane streams updates as they happen.

ADS is special: it bundles all the others on a single ordered stream. That ordering matters — you don't want a route referencing a cluster that hasn't been delivered yet. ADS prevents that race.

Istio: the control plane you'll actually meet

Istio is a complete service mesh. Its control plane component is a single binary called istiod.

What istiod does, on a loop:

  1. Watches Kubernetes — Services, Endpoints, Pods, plus Istio's own CRDs (VirtualService, DestinationRule, Gateway, AuthorizationPolicy, …).
  2. Translates the high-level intent into low-level Envoy primitives: listeners, clusters, routes, endpoints, TLS contexts.
  3. Pushes that config to every Envoy sidecar over an ADS stream.

Add to that:

  • Sidecar injection — when you label a namespace istio-injection=enabled, an admission webhook auto-injects the Envoy sidecar into every new pod.
  • iptables interception — an init container sets up rules so all inbound/outbound TCP transparently flows through the sidecar.
  • Cert authority — istiod issues short-lived certs to every workload, enabling mTLS by default.

The result: you write one Kubernetes-style CRD ("90% v1, 10% v2") and every relevant Envoy in the mesh ends up with the matching weighted_clusters config in seconds, no restarts.

What you've been writing, but generated

The mental click here is: the config Istio generates is exactly the shape of the config you've been writing by hand. xDS doesn't introduce new primitives — it just delivers the existing primitives over a stream instead of from a YAML file.

Run istioctl proxy-config cluster <pod> against any meshed pod and you'll see your Module 2 clusters. Run istioctl proxy-config route <pod> and you'll see your Module 3 weighted clusters and retry policies.

That's the whole reason this course front-loads static config: once you know the shape, every control plane in the world is just a config generator for the same skeleton.

Hands-on: a real Istio mesh on your laptop

This is the longest hands-on of the course, but the payoff is huge.

Hands-on · Install Istio and recognize your own work

1. Install kind and kubectl (skip if you already have them).

2. Spin up a cluster:

Shell
kind create cluster --name envoy-guide

3. Install Istio's CLI and demo profile:

Shell
curl -L https://istio.io/downloadIstio | sh -
cd istio-*/
export PATH="$PWD/bin:$PATH"
istioctl install --set profile=demo -y

4. Enable sidecar injection on the default namespace:

Shell
kubectl label namespace default istio-injection=enabled

5. Deploy the bookinfo sample:

Shell
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml

Wait for pods to be Running. They'll have two containers each — the app and the istio-proxy sidecar.

6. Read the config Istio generated:

Shell
istioctl proxy-config cluster <reviews-pod-name> -o yaml | head -60

Read it carefully. Recognize the shape — name, type: EDS, connect_timeout, load_assignment — all of it is what you wrote in Module 2. The only difference: type: EDS instead of STATIC, because endpoints arrive over xDS now.

Shell
istioctl proxy-config route <reviews-pod-name> -o yaml | head -60

Same recognition: virtual_hosts, routes, match, cluster. Familiar.

7. Apply a canary VirtualService and watch xDS push it:

Shell
kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-90-10.yaml
istioctl proxy-config route <productpage-pod> -o yaml | grep -A5 weighted_clusters

Boom — a weighted_clusters route appears in the relevant Envoy, generated by Istio in response to the CRD. Same primitive as Lesson 11, generated for you instead of typed by hand.

8. Tear down:

Shell
kind delete cluster --name envoy-guide
Real-world example · A platform team running a 500-service mesh
Problem
Service teams want self-serve canaries, mTLS, retry policies, and per-route rate limits — without a ticket to the platform team for every change. The platform team can't manually edit hundreds of Envoy YAML files daily.
Envoy solution
Service teams write VirtualService / DestinationRule / AuthorizationPolicy CRDs in their own repos. istiod watches them, generates the right Envoy primitives, and pushes via ADS to every relevant sidecar in seconds. Platform team owns the *control plane*; service teams own the *intent*. Nobody touches an envoy.yaml.

You finished the course 🎉

Recap, in one breath:

  • A proxy sits between two parties. Envoy is a fast, dynamic-config reverse proxy designed for microservices.
  • The data plane moves bytes; the control plane configures it.
  • Envoy config is built from listeners, filter chains, HCMs, HTTP filters, routes, clusters, and endpoints.
  • Real-world features — load balancing, TLS, retries, circuit breakers, canaries — are all just slots in that same skeleton.
  • Observability (logs, metrics, traces) is built in.
  • Sidecar = two containers, one network namespace.
  • Service meshes (Istio) = a control plane that generates the same Envoy primitives you wrote by hand, then pushes them via xDS.

You now know enough to read any Envoy config in the wild and operate a service mesh with confidence. Go build something.

Quick check

Which xDS service delivers the actual list of backend IP:port endpoints to a cluster?

Practical task
Finish the quick check and tick off the task to unlock.
Quick checkTasks 0/4