-
Notifications
You must be signed in to change notification settings - Fork 707
Description
Description:
Currently EnvoyGateway propagates xDS metadata for Route and VirtualHost resources, but not for Cluster and LbEndpoints.
Note that the main documentation page for this feature currently says the following:
Service, ServiceImport and Backend metadata and port name are propagated to envoy cluster metadata.
This is incorrect, as evident from the code since buildXdsCluster() never sets any metadata.
The proposal in this ticket is to:
Routemetadata be propagated toClusterxDS.
Each *RouteRule creates a distinct xDS cluster which encapsulates upstream endpoints of its backendRefs.
Accordingly, maybe we can put the *Route metadata into the Cluster xDS?
For example:
For a HTTPRoute as:
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1
metadata:
annotations:
gateway.envoyproxy.io/foo: bar
name: myroute
namespace: myns
spec:
rules:
matches:
- path:
type: PathPrefix
value: /mypath
we get:
name: httproute/myns/myroute/rule/0
type: CDS
[...]
metadata:
filter_metadata:
envoy-gateway:
resources:
- namespace: myns
groupVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
annotations:
foo: bar
name: myroute
BackendReference(Service,ServiceImport,Backend) metadata be propagated toLocalityLbEndpointsxDS.
If a *RouteRule contains multiple BackendReference, each of these are modeled as separate LocalityLbEndpoints.
Accordingly, maybe we can put the BackendReference metadata into the LocalityLbEndpoints xDS?
For example:
For a HTTPRoute as:
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1
metadata:
annotations:
gateway.envoyproxy.io/foo: bar
name: myroute
namespace: myns
spec:
rules:
- backendRefs:
- group: ""
kind: Service
name: svc-1
port: 3000
- group: ""
kind: Service
name: svc-2
port: 3000
we get:
clusterName: httproute/myns/myroute/rule/0
endpoints:
- lbEndpoints:
- endpoint:
address:
[...]
locality:
region: httproute/myns/myroute/rule/0/backend/0
metadata:
filter_metadata:
envoy-gateway:
resources:
- namespace: myns
groupVersion: ""
kind: Service
name: svc-1
- lbEndpoints:
- endpoint:
address:
[...]
locality:
region: httproute/myns/myroute/rule/0/backend/1
metadata:
filter_metadata:
envoy-gateway:
resources:
- namespace: myns
groupVersion: ""
kind: Service
name: svc-2
[optional Relevant Links:]
The feature is documented at https://gateway.envoyproxy.io/contributions/design/metadata/.