为linkerd更改Go服务名称

huangapple go评论127阅读模式
英文:

Go service name change for linkerd

问题

我已经在GKE(西部和东部集群)中配置了Linkerd,用于多集群目的。我使用了Google提供的这个演示应用程序:https://github.com/GoogleCloudPlatform/microservices-demo

我先用Istio配置,一切都正常,但是用Linkerd就不同了。如预期,从东部到西部集群导出的服务会在服务名称后面添加集群名称。例如,在西部集群中,你会得到currencyservice-east。

我认为我遇到的问题是,西部集群中的前端持续向currencyservice发送请求,而不是currencyservice-east。

在Istio中,我没有这个问题,因为Istio在集群之间使用相同的服务名称。我不是GO程序员,但我已经搜索了很多,想找出在前端源代码中定义服务名称的位置以进行更改,但没有成功。

另一个选择是让Linkerd在导出时保持服务名称不变。

请大家帮帮我。

英文:

I have configured linkerd with 2 clusters in GKE (west and east cluster) for multicluster purpose. I used this demo app provided by google https://github.com/GoogleCloudPlatform/microservices-demo

First I did it with Istio and everything worked out fine, but with linkerd its different. As expected the exported service from east to west cluster with get the cluster name appended to the service. eg in west cluster ,you will get currencyservice-east.

The problem I think I am having is that the frontend in the west cluster keeps sending request to currencyservice instead of currencyservice-east.

I didn't have this problem in Istio because Istio used the same service name across clusters. I am not a GO programmer, but I have googled my life to find out where the service name was defined in the frontend source code to change it but I have not succeeded.

another alternative will be for linkerd to maintain the service name while exporting it.

please guys help me.

答案1

得分: 1

你可以在源集群上使用TrafficSplit将对currentservice的调用重定向到currentservice-east

英文:

You can use a TrafficSplit on the source cluster to direct calls to currentservice to currentservice-east.

huangapple
  • 本文由 发表于 2021年11月15日 22:31:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/69976054.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定