Tcp客户端在使用Istio时无法连接到服务器

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

Tcp client not connecting to server when using istio

问题

我为在istio环境中检查TCP连接创建了两个示例应用程序(tcp-server和tcp-client)。使用以下链接在g0中创建服务器和客户端:

https://www.linode.com/docs/guides/developing-udp-and-tcp-clients-and-servers-in-go/

我在Kubernetes集群中部署了这些应用程序,并在没有istio的情况下进行了测试,一切正常。

但是,在安装istio(使用演示配置,按照此链接进行安装:https://istio.io/latest/docs/setup/getting-started/)并重新部署应用程序以填充envoy-proxy之后,客户端无法连接到服务器。

此外,使用以下命令可以使服务器成功连接:

sh -c "echo world | nc 10.244.1.29 1234"

我做错了什么?

英文:

I created two sample application(tcp-server and tcp-client) for checking TCP connection in istio environment. Used the below link to create server and client in g0

https://www.linode.com/docs/guides/developing-udp-and-tcp-clients-and-servers-in-go/

Deployed the application in kubernetes cluster and tested without istio, it is working fine.

But after installing istio(demo configuration, followed this url to install istio: https://istio.io/latest/docs/setup/getting-started/),
and redeploying the apps to fill with envoy-proxy, the client is not connecting to server

Also using below command makes the server connect success

sh -c "echo world | nc 10.244.1.29 1234" is 

What am I doing wrong?

答案1

得分: 1

发布我找到的解决方案。

问题:我尝试使用IP地址和NodePort连接到服务器,在Istio环境中无法正常工作。

解决方案:从客户端而不是提供服务器节点的IP地址和NodePort,而是提供服务器应用程序的服务名称和容器端口。

额外信息:要在集群外使用客户端,请为服务器创建网关和虚拟服务。在外部客户端中,将Istio入口Pod的NodePort和IP地址作为服务器目标。

英文:

Posting the solution I found.

Issue: I was trying to connect to server using ip address and nodePort, which some how not working in istio environment

Solution: From Client instead of providing ip address and nodePort of server node, give service name and container port of server app.

Extra Info: For using client from outside cluster, create gateway and virtual service for server. In your external client provide nodePort and ip address of istio-ingress pod as server destination

huangapple
  • 本文由 发表于 2021年9月12日 03:04:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/69145947.html
匿名

发表评论

匿名网友

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

确定