Description
Description:
Currently, Envoy Gateway supports a variety of envoy cluster settings through the BackendTrafficPolicy resource, such as:
- TCP Keep Alive
- Timeouts
- Health Checks
- Load Balancing algorithm
- Circuit Breakers
Envoy Gateway is adopting the use of BackendRef to represent external services in various resources, such as SecurityPolicy (ExtAuth), EnvoyExtensionPolicy (ExtProc), EnvoyProxy (OTEL sinks). With this change, reuse of existing backend-traffic policies that attach to Services, such as BackendTLSPolicy, is now possible for these backends. However, it's not possible to attach a BackendTrafficPolicy to Services. As a result, the above-mentioned cluster settings are not configurable for non-xRoute referenced backends.
Options:
- Split BackendTrafficPolicy to two policies. One policy will contain all fields that have an affinity to Envoy listeners (retries, rate limits, Fault... ) and will attach to
GatewayandxRoutes, while the other will contain all fields that have affinity to Envoy Clusters and will attach toServices. - Support attachment of BackendTrafficPolicy to Services.
- Create an extended BackendRef resource that supports configuration of relevant cluster settings, similar to support for weights in Gateway-API: https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.BackendRef
Metadata
Metadata
Assignees
Labels
area/apiAPI-related issues
Activity
arkodg commentedon Apr 1, 2024
+1 for 3.
davidalger commentedon Apr 2, 2024
+1 for 3.
github-actions commentedon May 10, 2024
This issue has been automatically marked as stale because it has not had activity in the last 30 days.
alexwo commentedon Jun 13, 2024
/assign
arkodg commentedon Jul 10, 2024
rethinking this one, we should also discuss option 4 - adding cluster settings into the
BackendAPI . This could eliminate duplication of cluster settings if multiple Policies are targeting the same backend.liorokman commentedon Jul 15, 2024
Looking at all of the suggested implementation options, I think none of them will work.
The problem is that most (if not all) of the knobs available in
BackendTrafficPolicyactually are attached to an Envoy Cluster definition, while theBackendresource and theBackendTargetRefarrays refer specifically to endpoints inside the Cluster definition.If
BackendTrafficPolicy(or the split part of that policy) attaches to a service, and the container that references the service has multiple services in it (because it's abackendTargetRefarray), then it's not possible to decide which of the attachedBackendTrafficPolicyresources is relevant for the entire cluster.These configurations should apply to an Envoy Cluster, and a
BackendRefis translated to endpoints in the Envoy Cluster, not to a Cluster. This means that it's not possible to disambiguate the configuration correctly.Backendrepresents an endpoint in a cluster, not a cluster. Adding the cluster settings into theBackendAPI leads to confusion when building up the Cluster definition if there are differences between the settings attached to each individualBackendRef.I think what is needed is to create an additional CRD that represents a
Clusterthat can be used for internal routes. Something like anEGConfigRouteorInternalRoutethat can be directly targetted with aBackendTrafficPolicyresource. This would actually represent an Envoy Cluster (i.e. a container of associatedbackendRefs), and be an internal type of xRoute.guydc commentedon Jul 17, 2024
In the last community meeting, the option to use weighted clusters
(clusters within clusters)was raised as a means of translating "cluster" settings derived from attributes found in backendRef.liorokman commentedon Jul 17, 2024
I'm not sure I follow. Could you show an example?
guydc commentedon Jul 17, 2024
cc @arkodg
Looking at the envoy config, it seems that weighted clusters are a route feature: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-weightedcluster. I misunderstood it to be a cluster feature.
For example, here:
gateway/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend-with-filters.routes.yaml
Line 31 in 9eff541
So, in the absence of an envoy route (which is the case here), this approach will not work. So, I think that we're back to considering a new container as the only viable option...
guydc commentedon Jul 23, 2024
Notes from last community meeting:
Proposal:
liorokman commentedon Aug 7, 2024
Still need to add support for cluster-level settings for the tracing and for accesslog definitions.