Skip to content
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

Can specify target address for rpc request #705

Closed
wenxuwan opened this issue Jul 8, 2022 · 4 comments · Fixed by #739
Closed

Can specify target address for rpc request #705

wenxuwan opened this issue Jul 8, 2022 · 4 comments · Fixed by #739
Labels

Comments

@wenxuwan
Copy link
Member

wenxuwan commented Jul 8, 2022

What would you like to be added:

用户请求rpc的时候可以指定provider的地址,layotto直接将请求发到目标ip地址去,而不需要转发给mosn。用作测试使用。

Why is this needed:

rpc请求的时候,一个service可能会有多个provider,在调试的时候,期望的是可以发到目标provider上,而不是默认的走负载均衡策略。当前layotto会转发到mosn走mosn的服务发现策略,用户无法在不更改配置文件的前提下将请求发送到目标provider。

Design for this issue:

当前rpc请求的结构定义如下:

image

因此可以允许用户在grpc的header里面塞一个固定的字段rpc_target_address来指定目标provider的ip地址。

同时在channel的定义中增加directpool,用来区分和mosn pool的区别。

image

于此同时该pool大小设置为0,不做连接池、即用完关闭。

@kevinten10
Copy link
Member

Hi,此功能是否可以兼容以下场景呢:

例如部署layotto + envoy,流量先经过layotto做处理,layotto再将流量直接转发给envoy。

  • 流量不经过mosn。可能是 `app -> (http/grpc) -> layotto -> (http) -> envoy -> target service
  • layotto->envoy走L7的http转发,而不是L4的ip转发。那是不是要加一个rpc_target_url

@wenxuwan
Copy link
Member Author

Hi,此功能是否可以兼容以下场景呢:

例如部署layotto + envoy,流量先经过layotto做处理,layotto再将流量直接转发给envoy。

  • 流量不经过mosn。可能是 `app -> (http/grpc) -> layotto -> (http) -> envoy -> target service
  • layotto->envoy走L7的http转发,而不是L4的ip转发。那是不是要加一个rpc_target_url

当前的layotto是可以通过下面的配置将invoke转成http协议的。所以说理论上协议应该使用当前的protocol字段来配置,只用一个rpc_target_address字段来指定目标地址就可以了。

image

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants