-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: MetaProtocol Proxy #18823
api: MetaProtocol Proxy #18823
Conversation
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
Minor update
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: ubuntu <ubuntu@localhost.localdomain>
Hi @zhaohuabing, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
@mattklein123 @htuch @rojkov @wbpcode Per our discussion, the merged work starts here. |
Thanks, this would be a great start. |
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Thanks @zhaohuabing @wbpcode. As mentioned before, I'm highly supportive of this work and this seems a solid architectural pattern. I've left a first round of comments on your doc; let's make sure we're all aligned on the details there before diving into code review. |
@htuch Thanks very much. 🌷 We will update our documentation as soon as possible. |
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Thanks for the tips @rojkov |
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this is super cool. Overall this LGTM but per some comments it would be nice to have some more fully formed config examples we can look at?
/wait
config.route.v3.WeightedCluster weighted_clusters = 2; | ||
} | ||
//TODO other configuration: RetryPolicy, Mirroring, Fault Injection, etc. | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's not great to have the duplication, but I would be OK starting from scratch and making sure we don't have ambiguity.
|
||
// [#protodoc-title: Meta Protocol Proxy Route Matcher Configuration] | ||
|
||
// Used to match request service of the downstream request. Only relevant when the application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible in this PR to have some config snippets? somewhere? I think that would really help.
@@ -0,0 +1 @@ | |||
Protocol buffer definitions for the MetaProtocol proxy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: delete, we don't need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted.
// The meta protocol proxies route table will be dynamically loaded via the Meta RDS API. | ||
MetaRds rds = 3; | ||
|
||
// The route table for the meta protocol proxy is static and is specified in this property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could potentially put examples here, or in the proto docs for RouteConfiguration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example of the meta protocol route configuration with matcher API has been added to the route.proto.
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
MetaRds rds = 3; | ||
|
||
// The route table for the meta protocol proxy is static and is specified in this property. | ||
RouteConfiguration route_config = 4; | ||
} | ||
|
||
// The codec which encodes and decodes the application protocol. | ||
config.core.v3.TypedExtensionConfig codec = 5 [(validate.rules).message = {required: true}]; | ||
|
||
// A list of individual Layer-7 filters that make up the filter chain for requests made to the | ||
// meta protocol proxy. Order matters as the filters are processed sequentially as request events | ||
// happen. If no meta_protocol_filters are specified, a default router filter | ||
// (`aeraki.meta_protocol.filters.router`) is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove aeraki.meta_protocol.filters.router
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nit comments.
// The name of the application protocol built on top of meta protocol. | ||
string application_protocol = 2 [(validate.rules).string = {min_len: 1}]; | ||
// The application protocol built on top of the meta protocol proxy. | ||
ApplicationProtocol application_protocol = 2 [(validate.rules).string = {min_len: 1}]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[(validate.rules).message = {required: true}];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
Hi, @mattklein123 Is there anything I can do to move this forward? Or did I miss something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM to merge as WiP, defer to @snowp for final look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment, this looks great to me!
// Used to match request service of the downstream request. Only relevant when the application | ||
// protocol is RPC such as Dubbo or Thrift. | ||
// [#not-implemented-hide:] | ||
message ServiceMatchInput { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are service and method just special properties that we think are common enough to have specific types? Or is there something else that makes them special?
I would probably have the comment be a bit more vague here if they are just special properties, like Only applicable if a method provided by the application protocol
. gRPC for example is an RPC protocol that doesn't use methods (outside of google.api.annotations)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snowp your concern is legitimate, not every RPC protocol has these two properties.
Signed-off-by: huabingzhao <huabingzhao@tencent.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This PR proposes a MetaProtocol proxy that provides a framework for layer-7 protocols. The common capabilities, including routing, tracing, metrics, logging, etc., will be built into the MetaProtocol proxy. This approach has the potential to significantly lower the barrier to writing new Envoy filters: instead of writing fully functional network filters and duplicating similar codes, now we only need to implement the codec interface. Furthermore, MetaProtocol makes it much easier to build a unified control plane and it could be very helpful for the service mesh ecosystem.
This PR is a merged efforts of #18768 and #18209
This PR is the APIs of the MetaProtocol Proxy. The implementation will be pushed later after the community agrees on the design and finalizes the API.
Related issues:
Common framework for layer-7 protocols #18761
generic proxy support: #18209
Generic Access Log: #13085
Generic Routing & Rds: #9656
Commit Message: Add API for MetaProtocol Proxy
Additional Description:
Design doc: https://docs.google.com/document/d/1y_ALyjGp_H1_TRrrRxZxnqENISqeZI6eLn71FAFsZPk/edit?usp=sharing
Istio blog about MetaProtocol: https://istio.io/latest/blog/2021/aeraki/
This design has been proven working in Aeraki : https://github.com/aeraki-framework/meta-protocol-proxy
Risk Level: low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]