Direct (PROXY-protocol) mode
A walkthrough of setting up Envoy Gateway when your cluster’s load balancer uses PROXY protocol v2
This section introduces Envoy Gateway as the ingress controller in our
Elastx Kubernetes CaaS service. We manage and upgrade the controller, the
Gateway API CRDs and the cluster-scoped
GatewayClass named eg. You create the Gateway API
objects that describe your own traffic in your own namespaces.
Envoy Gateway is not installed by default. Ask our support to turn it on for
your cluster. You choose direct or proxy mode yourself, on your own Gateway
(see below).
If you use our managed cert-manager, we turn on its Gateway API support at the
same time, so it can issue certificates for your Gateway.
There are companion guides for the two ways traffic typically reaches the cluster. Pick the one that matches your setup:
A cluster has one shared Gateway in a dedicated namespace (for example
gateway) that serves routes from all your application namespaces through a
single OpenStack load balancer and IP. This is the standard setup and the
direct equivalent of ingress-nginx, where a single controller fronted every
host in the cluster. Each application namespace opts in with a
shared-gateway-access: "true" label and contributes its own HTTPRoutes,
and never touches the shared Gateway.
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#DAE7EC','primaryBorderColor':'#1E343E','primaryTextColor':'#1E343E','lineColor':'#5A7A8A','clusterBkg':'#EEF3F6','clusterBorder':'#9BB3BF','edgeLabelBackground':'#FFFFFF'}}}%%
flowchart TB
client(["Clients"]):::client --> lb["OpenStack load balancer<br/>one LB · one IP"]:::lb
lb --> gw
subgraph gwns["gateway namespace"]
gw["Gateway 'shared'"]:::gw
ctp["ClientTrafficPolicy"]:::policy
cert["TLS certificates<br/>per hostname"]:::policy
end
ctp -.->|attaches to| gw
cert -.->|terminates TLS| gw
subgraph ta["team-a namespace"]
appa["app + HTTPRoute"]:::app
end
subgraph tb["team-b namespace"]
appb["app + HTTPRoute"]:::app
end
gw -->|"team-a.example.com"| appa
gw -->|"team-b.example.com"| appb
classDef client fill:#FFFFFF,stroke:#1E343E,color:#1E343E;
classDef lb fill:#DAE7EC,stroke:#1E343E,color:#1E343E;
classDef gw fill:#FBBD18,stroke:#1E343E,stroke-width:2px,color:#1E343E;
classDef policy fill:#F5F8FA,stroke:#1E343E,color:#1E343E;
classDef app fill:#DAE7EC,stroke:#1E343E,color:#1E343E;
Each Gateway provisions its own OpenStack load balancer, so a single shared
Gateway keeps your cluster on one load balancer, one IP and one
ClientTrafficPolicy: the same single-entry-point model you had with
ingress-nginx. TLS is terminated centrally in the gateway namespace, with one
certificate per hostname (Envoy serves the right one per request by SNI). The
walkthroughs below use this layout throughout. Running more than one
Gateway, a separate load balancer for a single namespace via
allowedRoutes.namespaces.from: Same, is a non-standard setup for the rare case
that genuinely needs an isolated IP or blast radius.
In the dedicated gateway namespace (once, by whoever owns ingress):
Gateway: listeners, ports, protocols, TLS; allowedRoutes selecting the
shared-gateway-access: "true" label.ClientTrafficPolicy: controls PROXY-protocol handling, TLS parameters, timeouts.
Must live in the same namespace as the Gateway.Certificate / Issuer (cert-manager): one certificate per hostname you
serve (HTTP-01 in direct mode, DNS-01 in proxy mode).HTTPRoute on the http listener, to
match ingress-nginx’s ssl-redirect behaviour for every host.In each application namespace (per team, self-service):
shared-gateway-access: "true" namespace label.HTTPRoute, GRPCRoute: routing rules, attached to the shared Gateway
via cross-namespace parentRefs.BackendTrafficPolicy: retries, circuit breaking.SecurityPolicy: JWT, OIDC, CORS.BackendTLSPolicy: mTLS toward your backends.You reference the cluster GatewayClass by its name eg from the
Gateway. You do not need to create or modify any cluster-scoped resources.
The OpenStack load balancer in front of Envoy runs in TCP mode in both
cases. The variants differ in how the real client IP arrives at
Envoy, and your ClientTrafficPolicy has to match.
Gateway, and the load balancer then prepends a PROXY header carrying
the real client IP. Your ClientTrafficPolicy must enable
proxy-protocol parsing.
See Direct (PROXY-protocol) mode.X-Forwarded-For; the load balancer
passes the request through unchanged. Your ClientTrafficPolicy must
trust that header with the right hop count.
See Proxy (X-Forwarded-For) mode.If you used our managed ingress-nginx, the two modes carry over directly; only the names and the resources you write have changed:
| ingress-nginx | Envoy Gateway | When it applies |
|---|---|---|
Direct mode (use-proxy-protocol: "true") |
Direct (PROXY-protocol) mode | Clients connect straight to our load balancer. No upstream proxy. The most common setup. |
Proxy mode (use-forwarded-headers: "true") |
Proxy (X-Forwarded-For) mode | You run your own CDN / WAF / edge proxy in front of the load balancer. |
Unlike ingress-nginx, the mode is not a cluster-level setting: you choose
it on your own Gateway. For direct mode, you add the PROXY-protocol
annotation to the Gateway and a ClientTrafficPolicy that expects the
header. For proxy mode, you leave the annotation off and write a
ClientTrafficPolicy that trusts X-Forwarded-For (see the two guides
above).
Proxy mode requires your own upstream proxy. X-Forwarded-For mode only makes sense when a CDN, WAF, or edge proxy actually sits in front of the load balancer and injects the header. Without one, no real client IP ever reaches Envoy and your backends see only the load balancer. If clients connect directly to Elastx, use direct (PROXY-protocol) mode instead. It carries the client IP for you and needs no CDN.
ingress-nginx has been retired upstream, as announced in the Kubernetes 1.34 changelog. For the full move, see Migrating from ingress-nginx.
Both walkthroughs terminate TLS on the shared Gateway, with cert-manager
issuing one certificate per hostname into the gateway namespace (the same
namespace as the Gateway). The validation method differs by mode: direct mode
uses ACME HTTP-01 (clients reach the load balancer directly), while proxy mode
uses DNS-01 (public DNS points at your upstream proxy, so HTTP-01 cannot reach
Envoy). If you need a guide for installing cert-manager, see
Install and upgrade cert-manager.
If you serve gRPC through a Gateway and set TLS options in a
ClientTrafficPolicy (for example client-certificate validation), also list
h2 in tls.alpnProtocols. Without it, Envoy may offer no HTTP/2 during the
TLS handshake, and gRPC clients refuse the connection.
spec:
tls:
alpnProtocols:
- h2
- http/1.1
For more advanced use cases please refer to the documentation provided by each project or contact our support:
A walkthrough of setting up Envoy Gateway when your cluster’s load balancer uses PROXY protocol v2
A walkthrough of setting up Envoy Gateway when your traffic arrives via an upstream proxy that injects X-Forwarded-For
How to move from managed ingress-nginx to Envoy Gateway, in direct or proxy mode