envoyproxy / envoyproxy/envoy

Support generic protocol routing

Open
#9,656 12 comments 3 reactions 0 assignees View on GitHub
design proposal help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

Description

*Title*: *Provide a generic schema and implementation for custom protocol routers*

*Description*:
Looking at the custom protocol filters that have been added to Envoy very few of them support much in the way of routing, for the ones that do (Dubbo, Redis and Thrift ) there is a lot of semantic & impl duplication. It seems like there is an opportunity to provide a generic routing facility to filter implementations.

Generally speaking the Dubbo and Thrift ones are very HTTP-like, the Redis one is simpler but essentially is a path prefix match with some stripping.

I wonder if it makes sense for Envoy to canonicalize a schema and provide a default implementation for the filters to use? This seems like a decent win for filter implementers...

attrs = extract_protocol_features(bytes)
cluster = generic_router.resolve(attrs)
send_stuff_to_cluster(cluster)

If Envoy standardized this mechanism and a schema to configure the router then it simplifies life for most filter implementers and it helps control planes by having a standard schema for them to work with.

We already have fairly generic support for a system like this using CEL but we can choose to use other representations for the match conditions, e.g. flattened attribute matches like those in http route matching.

Assuming this made sense there are further considerations like extending this to work with an RDS-like mechanism etc for dynamic loading

It seems like this has been discussed in the context of UDPA too.

*Relevant Links*
[UDPA](https://docs.google.com/document/d/1orxTIL9FXtgmyl5TtPRBqGjgp1ekL7oOKDd95wxeCRY/edit#)
[Dubbo Route](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/dubbo_proxy/v2alpha1/route.proto#envoy-api-msg-config-filter-network-dubbo-proxy-v2alpha1-route)
[Thrift Route](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/thrift_proxy/v2alpha1/route.proto#envoy-api-msg-config-filter-network-thrift-proxy-v2alpha1-route)
[Redis Route](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/redis_proxy/v2/redis_proxy.proto#envoy-api-msg-config-filter-network-redis-proxy-v2-redisproxy-prefixroutes-route)
[Istio Discussion](https://github.com/istio/istio/issues/18981#issuecomment-573055359)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.