Skip to main content

Envoy Proxy

Envoy is an open-source, high-performance Layer 7 proxy originally built at Lyft. It is the sidecar proxy used by Istio and many other service meshes, handling mTLS, load balancing, retries, circuit breaking, metrics, and tracing for service traffic.

What Envoy is

Envoy runs as a separate process next to an application, so any language benefits without a client library. It understands HTTP, gRPC, and TCP. In Istio, the sidecar container named istio-proxy is Envoy.

Dynamic configuration with xDS

Envoy in a mesh does not read static files. The control plane streams configuration over the xDS APIs, so routes, clusters, endpoints, and certificates update without restarts.

API Provides
LDS and RDS Listeners and routes
CDS and EDS Upstream clusters and endpoints
SDS Certificates and keys
flowchart LR I["istiod"] -->|"xDS stream"| E["Envoy sidecar"] R["Inbound request"] -->|"mTLS"| E E -->|"plain HTTP"| A["Application"] E -->|"metrics"| M["Prometheus"] classDef ctl fill:#8B5CF6,color:#ffffff classDef proxy fill:#DBEAFE,color:#1E293B classDef other fill:#D1FAE5,color:#1E293B class I ctl class E proxy class R,A,M other

Inspecting Envoy

Bash
istioctl proxy-status
istioctl proxy-config routes orders-7d9f8c.production
kubectl exec -n production orders-7d9f8c -c istio-proxy -- \
curl -s localhost:15090/stats/prometheus | grep istio_requests_total

Key metrics include istio_requests_total and istio_request_duration_milliseconds.

Envoy vs Linkerd's proxy

Envoy Linkerd proxy
Language C++ Rust
Features Very rich, WebAssembly extensions Focused on core use cases
Overhead Higher Lower
Remember

You rarely configure Envoy directly. You write Istio resources and Istio generates the Envoy configuration.

Common Mistake

Assuming a STALE status in istioctl proxy-status is harmless. A stale proxy may apply outdated routes, so investigate control plane connectivity.

Frequently Asked Questions

Why did Istio choose Envoy rather than build its own proxy?

Envoy already offered dynamic configuration through xDS, rich L7 telemetry, and production-grade load balancing. Istio focuses its control plane on translating policy into Envoy configuration.

What is the main gotcha running Envoy as a sidecar?

Per-pod overhead and startup ordering. If the app starts before the sidecar is ready, early outbound calls fail. Native sidecar containers in recent Kubernetes versions address ordering.

Is Envoy only used in Istio?

No. It is also used by Envoy Gateway, Contour, several API gateways, and cloud load balancers, as well as other meshes.

Found a mistake, an outdated step or a broken link?