Tasks for Envoy Gateway
TOC
OverviewPrerequisitesAdvanced TasksOpenTelemetry (OTel)How To Attach to Listener Created In Other NamespaceHow To Use a Certificate Created In Another NamespaceHow To Use SSL PassthroughHow To Change the Minimum TLS VersionHow To Specify NodePort When Using NodePort ServiceHow To Add Pod Annotations In Envoy GatewayHow To Set NodeSelector And Tolerations Forenvoy-gateway-operatorHow To Set NodeSelector And Tolerations For envoy-gatewayHow To Set NodeSelector And Tolerations For envoy-proxyHow To Use hostNetwork In envoy-proxyApproach 1: Using Port Offset (Default, Recommended)Approach 2: Using Privileged Ports Directly with useListenerPortAsContainerPortHow To Access a LoadBalancer VIP from Within the ClusterRelated DocumentationMore ConfigurationOverview
This document extends the main configuration path (operator → gateway → route → policy) and introduces advanced tasks beyond the standard resource configurations covered in the previous documents.
When applying configuration changes in the Gateway API, there are three primary approaches available:
- Modify standard Gateway API resources: Directly edit
Gateway,HTTPRoute,TCPRoute,UDPRoute, and other core resources. - Attach policies via PolicyAttachment: Use
SecurityPolicy,ClientTrafficPolicy,BackendTrafficPolicy, and other policy resources to extend Gateway and Route behavior. - Configure global settings: Modify the
EnvoyGatewayCtlto changeenvoy-gatewayinstance behavior or other global settings that affect all gateways.
This document focuses on advanced tasks and special scenarios that are not part of the main configuration path, including cross-namespace routing, observability setup, deployment customization, and troubleshooting.
Prerequisites
Advanced Tasks
OpenTelemetry (OTel)
Please follow instructions in OpenTelemetry Integration, but use EnvoyGatewayCtl to modify the envoy-gateway-config.
How To Attach to Listener Created In Other Namespace
In the Gateway's listener configuration, you need to specify which namespaces are allowed to attach Routes to it.
Please refer to Cross-Namespace routing for more details.
How To Use a Certificate Created In Another Namespace
To use a certificate created in another namespace, create a ReferenceGrant in the namespace where the certificate is stored. Please follow instructions in cross-namespace-certificate-references and referencegrant.
You cannot specify individual secret resources; you must allow the entire namespace
How To Use SSL Passthrough
Please follow instructions in
How To Change the Minimum TLS Version
Please follow instructions in customize-gateway-tls-parameters
The .spec.tls field in ClientTrafficPolicy is clienttlssettings.
If you need to customize cipher suites in addition to the minimum TLS version, refer to the same upstream task and API
reference.
How To Specify NodePort When Using NodePort Service
When using a NodePort service, Kubernetes assigns a NodePort value to each service port. When accessing the service through a node IP, use the assigned NodePort instead of the service port.
There are two approaches:
Manually retrieve the NodePort assignment by following get nodeport from svc port.
Manually specify the NodePort in the EnvoyProxy configuration instead of letting Kubernetes automatically assign it.
- Use patch field to patch the generated service resource to specify the NodePort
NodePort can only be within a specific range, typically 30000-32767. If you want the Gateway listener port and NodePort to be consistent, your listener port must also be within the NodePort range.
How To Add Pod Annotations In Envoy Gateway
How To Set NodeSelector And Tolerations For envoy-gateway-operator
Update the Subscription resource.
How To Set NodeSelector And Tolerations For envoy-gateway
Update the EnvoyGatewayCtl resource.
How To Set NodeSelector And Tolerations For envoy-proxy
Update the EnvoyProxy resource.
How To Use hostNetwork In envoy-proxy
Using hostNetwork: true allows the Envoy proxy pods to use the host network namespace directly. This can be useful for:
- achieving better network performance
- accessing the gateway through the node IP directly
Considerations:
- Pods using hostNetwork will bind directly to the host's network interfaces
- Port conflicts may occur if multiple pods try to use the same port on the same node
- Security isolation is reduced as pods share the host's network namespace
- You should use
nodeSelectororaffinityrules to control pod placement and avoid port conflicts
There are two approaches to configure hostNetwork, depending on whether you want to use privileged ports (< 1024) directly:
Approach 1: Using Port Offset (Default, Recommended)
This is the default and recommended approach. Envoy Gateway automatically adds an offset of 10000 to privileged ports to avoid requiring special permissions.
Pros:
- No special permissions or capabilities required
- More secure because it runs as a non-root user without additional privileges
- Simpler configuration
- Works out of the box
Cons:
- Clients must use offset ports (10080, 10443)
Configuration:
Access:
- Port 80 → Access via
http://<node-ip>:10080 - Port 443 → Access via
https://<node-ip>:10443
Approach 2: Using Privileged Ports Directly with useListenerPortAsContainerPort
This approach allows Envoy to bind to privileged ports (< 1024) directly, such as port 80 and 443.
Pros:
- Can use standard ports (80 and 443) directly
- Better compatibility with clients expecting standard ports
Cons:
- Requires NET_BIND_SERVICE capability
- Slightly reduced security compared to port offset approach
- More complex configuration
Configuration:
Access:
- Port 80 → Access via
http://<node-ip>:80 - Port 443 → Access via
https://<node-ip>:443
How To Access a LoadBalancer VIP from Within the Cluster
By default, Envoy Gateway creates LoadBalancer services with externalTrafficPolicy: Local. This policy preserves client source IP addresses but has an important limitation: requests from cluster nodes without Envoy Gateway pods will fail because traffic is not forwarded to other nodes.
Solution 1: Use Service ClusterIP (Recommended for in-cluster access)
For applications running inside the cluster, use the service ClusterIP instead of the LoadBalancer VIP. This avoids the routing limitation entirely.
Solution 2: Change to Cluster Traffic Policy
If you need to access the LoadBalancer VIP from any cluster node, change externalTrafficPolicy to Cluster:
Related Documentation
More Configuration
Please refer to EnvoyGateway Tasks