When applying configuration changes in the Gateway API, there are three primary approaches available:
Gateway.Gateway Api and Envoy Gateway.envoy-gateway instance.Envoy Gateway provides a rich custom policy mechanism that can be attached to gateway resources through the Gateway API's PolicyAttachment model.
Envoy Gateway policies are divided into multiple types, including security policies, traffic management policies and more. These policies can be applied to different levels of resources, such as Gateway, HTTPRoute, or Service.
The Gateway API's PolicyAttachment mechanism allows users to attach policies to gateway resources in a declarative way. This mechanism is implemented through the targetRefs field, which specifies the target resource for policy application. For example, policies can be attached to specific Gateways, HTTPRoutes, or Services.
Policy types supported by Envoy Gateway include:
| Policy Type | Description |
|---|---|
| ClientTrafficPolicy | Configuration related to the client-to-proxy communication path, including parameters such as timeouts, retries, keepalive settings, etc. |
| BackendTrafficPolicy | Configuration related to the proxy-to-backend communication path, including parameters such as timeouts, retries, keepalive settings, etc. |
| SecurityPolicy | Configuration related to security mechanisms and controls, such as authentication and authorization. |
Using the PolicyAttachment mechanism, users can flexibly add, modify, or delete policies without modifying core resource definitions, achieving separation of concerns and better resource management.
The configuration related to envoy-gateway instance itself or global-level configuration related to all gateways belongs to this envoy-gateway instance, such as deployment mode or backend routing.
We recommend using EnvoyGatewayCtl to manage those global configurations.
| Feature | CR | Description |
|---|---|---|
| Auth | envoygateway:SecurityPolicy | Authorization |
| CORS | gatewayapi:HTTPRoute | Cross-Origin Resource Sharing |
| Header Modification | gatewayapi:HTTPRoute | HTTP Header Modification |
| HTTP Redirect | gatewayapi:HTTPRoute | HTTP Redirect |
| L7 Timeout | gatewayapi:HTTPRoute | Request Timeouts |
| SessionAffinity | gatewayapi:HTTPRoute | Session Affinity/Sticky Sessions |
| L7 Keepalive | envoygateway:ClientTrafficPolicy | L7 Keepalive Timeout Settings |
| L4 Keepalive | envoygateway:ClientTrafficPolicy | L4 TCP Keepalive Settings |
| UrlRewrite | gatewayapi:HTTPRoute | URL Rewrite |
| Retry | gatewayapi:HTTPRoute or envoygateway:BackendTrafficPolicy | Request Retries Config Via HTTPRoute Request Retries Config Via EnvoyGateway |
| GZip | envoygateway:BackendTrafficPolicy | HTTP Compression |
Please follow instructions in OpenTelemetry Integration, but use EnvoyGatewayCtl to modify the envoy-gateway-config.
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.
To use a certificate created in another namespace, you need to create a ReferenceGrant in the namespace where the certificate is created. Please follow instructions in cross-namespace-certificate-references and referencegrant.
You cannot specify individual secret resources; you must allow the entire namespace
Please follow instructions in
Please follow instructions in customize-gateway-tls-parameters
the .spec.tls in ClientTrafficPolicy is clienttlssettings
When using a NodePort service, kubernetes assigns a NodePort port number to each service port. When accessing the service through a node IP, you should use the corresponding NodePort port number rather than the service port.
There are two approaches to handle this:
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.
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.
update the Subscription resources
update the EnvoyGatewayCtl resources
update the EnvoyProxy resources
Please refer to EnvoyGateway Tasks