-
Notifications
You must be signed in to change notification settings - Fork 786
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
kitex 在 k8s+istio 架构中,服务间调用无法实现header头流量转移 #849
Comments
hertz-api 的client code
|
具体环境是什么?envoy 作为 proxy 吗?还是说使用了 kitex 的 proxyless 模式 |
envoy 作为 proxy |
首先,如你所说,配置的是 http header 的VirtualService规则,而 kitex 默认使用的是 thrift 协议,所以不会生效。 不过,Istio 对 thrift 协议的支持确实非常有限,有需求的话可以配置 Thrift proxy Filter 以实现路由。 这里有一个示例,可以参考尝试配置:https://github.com/cloudwego/kitex-examples/blob/main/proxyless/yaml/server/thrift_proxy.yaml |
我用的grpc |
那可能得单独再看看,是否方便提供一个可复现的demo,我这边看一下。 |
好的,我本地验证一下。 |
您好,这问题好处理不 |
我改成kitex 的 proxyless 模式了,不用sidecar, demo地址 https://github.com/booldesign/mesh-demo/tree/xds
|
抱歉,这两天暂时没有时间看这个问题,后续会继续跟进 |
参考一下 https://github.com/cloudwego/biz-demo/tree/main/bookinfo 试试能不能将 bookinfo run 起来,如果可以 run 起, 再看看 diff,找不到 diff 的话直接 copy bookinfo 快速解决吧 @booldesign |
如果 bookinfo 运行不起来的话说明环境有问题,看一下环境配置,如果能运行起来的话说明代码配置相关有问题,找找代码 diff 配置。 |
和 istio 没太大关系哈,是 K8S 相关的配置有误导致的 https://github.com/booldesign/mesh-demo/blob/xds/deploy/kube/cloud.yaml#L156 这边 可以直接改成 pod 的 port,如下 |
环境问题...🥺 |
不是环境问题哈,是K8S Service配置问题 |
配置问题 |
targetPort可以不设,用缺省 |
嗯嗯,缺省也可以的 |
测试环境:k8s+istio 架构,服务发现是用原生的istio
系统版本:
k8s:版本:v1.25.4
istio版本:1.17.1
docker 20.10.23
kitex 做service 给 hertz做rpc调用
需求说明
api服务有v1/v2版本
hertz-api-v1 / hertz-api-v2
service服务也有v1/v2版本
kitex-rpc-v1 / kitex-rpc-v2
凡是有header头
branch:v2
的都走v2的版本
遇到的问题:
hertz-api 服务的VirtualService规则,header有v2标签时可以,打到hertz-api-v2的服务上,
但kitex的VirtualService规则没有达到效果,一直是轮询的方式,v1/v2都会请求到
hertz-api的VirtualService
kitex-rpc的VirtualService
The text was updated successfully, but these errors were encountered: