123DevOps··7 min read

What is Envoy Proxy? Listeners, clusters, filters, and xDS in practice

Learn what Envoy is, how listeners, filter chains, routes, and clusters work, what the xDS API is, and why it sits underneath Istio and several API gateways. With a tested configuration and real curl output.

Kubernetes

If you use Istio, Emissary-ingress, Envoy Gateway, Contour, or some managed cloud load balancers, there’s a good chance your traffic goes through an Envoy without you ever writing a line of its configuration. Understanding Envoy helps you read the logs, metrics, and errors of those tools, and decide when it’s worth using it directly.

What Envoy is

Envoy is a high-performance L3/L4 and L7 proxy written in C++, created at Lyft and open sourced in 2016. The project’s core idea is that the network should be transparent to applications: the proxy runs out of process, next to the application, and handles routing, retries, TLS, load balancing, and telemetry for any language.

At the CNCF, Envoy joined in September 2017 as incubating and became graduated in November 2018, one of the first projects to reach that level. As of November 2026 it is still graduated (check the project page). The license is Apache 2.0, and the latest release I saw on the GitHub page was v1.40.2.

What problem it solves

Before Envoy, each service implemented resilience and observability inside language-specific libraries. Envoy standardizes this in the network:

  • Edge proxy: terminates TLS, routes by host and path, applies rate limiting and authentication.
  • Service proxy (sidecar or per node): handles mTLS, retries, timeouts, and circuit breaking between services. This is its role in Istio.
  • Protocol translation: speaks HTTP/1.1, HTTP/2, and HTTP/3 (the latter still marked alpha in the documentation) and has first-class gRPC support.
  • Observability: detailed statistics for every listener and cluster, access logs, and distributed tracing.

How it works

Envoy’s configuration revolves around five concepts:

Concept What it is Example
Listener Address and port where Envoy accepts connections 0.0.0.0:10000
Filter chain Sequence of network (L3/L4) filters applied to the listener’s connections http_connection_manager, tcp_proxy
HTTP filters L7 filters inside http_connection_manager, always ending with router JWT authentication, rate limit, CORS, router
Route Rule that matches host/path/header and picks a cluster prefix: /api → api_service
Cluster Group of upstream endpoints with a load balancing policy and health checks 127.0.0.1:8081

The flow of an HTTP request is: the listener accepts the connection → the http_connection_manager network filter decodes HTTP → HTTP filters process the request → the router filter picks the route → the route points to a cluster → Envoy picks an endpoint from the cluster and forwards the request.

xDS: dynamic configuration

In a static file, like the example below, everything is fixed. In production, Envoy usually receives configuration from a control plane through xDS, a set of gRPC (or REST) discovery APIs:

API Resource Configures
LDS Listener Listeners
RDS RouteConfiguration A listener’s routes
CDS Cluster Upstream clusters
EDS ClusterLoadAssignment Each cluster’s endpoints
SDS Secret TLS certificates and keys

ADS (Aggregated Discovery Service) carries all types over a single gRPC stream, so the control plane can order updates without dropping traffic. xDS comes in two variants: state of the world (each response carries the full set) and incremental/delta (only the changes). istiod, Emissary-ingress, and Envoy Gateway are examples of control planes that speak xDS.

Built-in resilience

Each cluster comes with protection mechanisms that, in other stacks, would be scattered across the code:

  • Circuit breakers: per-cluster limits on connections, pending requests, active requests, and concurrent retries. The defaults are conservative (1024 connections, for example) and show up in the admin /clusters endpoint.
  • Outlier detection: temporarily removes from load balancing an endpoint that piles up consecutive 5xx errors.
  • Active health checks: HTTP, TCP, or gRPC, configured on the cluster itself.
  • Per-route retries and timeouts: as in the example below, with retry_policy and timeout.

This is exactly the toolbox that service meshes expose through friendlier CRDs.

Hands-on example

The configuration below creates a public listener on port 10000 that sends /api to a cluster called api_service (with a timeout and retries) and answers / directly. To keep the test self-contained, the “backend” is a second listener on the same Envoy, at 127.0.0.1:8081:

admin:
  address:
    socket_address: { address: 0.0.0.0, port_value: 9901 }

static_resources:
  listeners:
  - name: listener_public
    address:
      socket_address: { address: 0.0.0.0, port_value: 10000 }
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: ingress_http
          route_config:
            name: local_routes
            virtual_hosts:
            - name: app
              domains: ["*"]
              routes:
              - match: { prefix: "/api" }
                route:
                  cluster: api_service
                  timeout: 2s
                  retry_policy:
                    retry_on: "5xx"
                    num_retries: 2
              - match: { prefix: "/" }
                direct_response:
                  status: 200
                  body: { inline_string: "ok from envoy\n" }
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

  # fake "backend": a second listener that answers directly
  - name: listener_backend
    address:
      socket_address: { address: 127.0.0.1, port_value: 8081 }
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: backend_http
          route_config:
            virtual_hosts:
            - name: backend
              domains: ["*"]
              routes:
              - match: { prefix: "/" }
                direct_response:
                  status: 200
                  body: { inline_string: "{\"service\":\"api\",\"status\":\"ok\"}\n" }
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

  clusters:
  - name: api_service
    type: STATIC
    connect_timeout: 1s
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: api_service
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address: { address: 127.0.0.1, port_value: 8081 }

First, validate the file without starting anything. I tested with the envoyproxy/envoy:v1.36.7 image:

docker run --rm -v "$PWD":/cfg envoyproxy/envoy:v1.36.7 --mode validate -c /cfg/envoy.yaml
# ...
# configuration '/cfg/envoy.yaml' OK

Then run it for real and send requests:

docker run -d --name envoy -p 10000:10000 -p 9901:9901 \
  -v "$PWD":/cfg envoyproxy/envoy:v1.36.7 -c /cfg/envoy.yaml

curl -i localhost:10000/api/orders
curl localhost:10000/

The real output was:

HTTP/1.1 200 OK
content-length: 32
content-type: text/plain
date: Wed, 25 Nov 2026 07:53:13 GMT
server: envoy
x-envoy-upstream-service-time: 0

{"service":"api","status":"ok"}
ok from envoy

The server: envoy and x-envoy-upstream-service-time headers show that the response went through the proxy and the upstream cluster. The admin interface (port 9901) shows the internal state:

curl -s localhost:9901/ready
curl -s localhost:9901/clusters | grep health_flags
curl -s localhost:9901/stats | grep -E "api_service.upstream_rq_(total|200)"
LIVE
api_service::127.0.0.1:8081::health_flags::healthy
cluster.api_service.upstream_rq_200: 1
cluster.api_service.upstream_rq_total: 1

In production, never expose the admin interface on 0.0.0.0: it lets anyone change log levels, drain listeners, and even shut down the process. Use 127.0.0.1 or a local socket.

When to use it (and when not to)

Use Envoy directly when:

  • you need a programmable L7 proxy with rich telemetry, and you want to control every detail;
  • you’re going to build your own control plane (with go-control-plane, for example);
  • you need gRPC, HTTP/2, or advanced load balancing at the edge.

Prefer a tool that generates Envoy configuration for you when:

  • the goal is ingress or an API gateway on Kubernetes: Envoy Gateway, Emissary-ingress, or Contour translate CRDs into xDS;
  • the goal is mTLS and service-to-service traffic: a service mesh such as Istio;
  • you only need to serve static files or a simple reverse proxy: NGINX gets it done with less complexity.

Envoy’s YAML is verbose on purpose: it was designed to be generated by machines.

Alternatives

Proxy Language Highlight
Envoy C++ xDS, telemetry, foundation of many meshes and gateways
NGINX C Classic web server and reverse proxy
HAProxy C Very efficient L4/L7 load balancing
Traefik Go Automatic discovery and simple configuration
Linkerd2-proxy Rust Linkerd’s purpose-built micro-proxy

To see where Envoy fits into cluster networking, read Kubernetes networking.

Summary

  • Envoy is an L3/L4/L7 proxy in C++, CNCF graduated (as of November 2026)
  • The listener accepts connections, the filter chain processes, the route chooses, the cluster forwards
  • Every http_connection_manager ends with the envoy.filters.http.router filter
  • xDS (LDS, RDS, CDS, EDS, SDS) enables dynamic configuration; ADS aggregates it all in one stream
  • Always validate with --mode validate before starting
  • Never expose the admin interface outside the host
  • On Kubernetes, you almost always use Envoy through a control plane

You may never write an envoy.yaml in production, but you’ll read its headers, metrics, and errors all the time.

Get updates on new posts and stay in the loop!