无法使用ServiceName或DomainName在POD中访问POD中的clusterip_service或Internet

发布于 2025-01-23 20:37:56 字数 1699 浏览 4 评论 0 原文

我有 2 pods (pod1,pod2),带有 2 Services (Service1 Links Pod1,service2 links POD2)在同一名称空间中。

在POD1中,我在测试下进行了。我使用 kubectl exec ...

  • 使用 wget> wget pod2ipaddress - 成功

    ,我使用 kubectlexec。
  • 调用RESTAPI在POD2中暴露于POD2中使用 WGET> WGET SERVICE2IPADDRESS Success> Success> - Success

    调用RESTAPI
  • 调用RESTAPI在POD2中暴露于POD2中使用 WGET SERVICE2NAME 无法解决pcgameSapp -service -service -service -service -service -service -service -service -service -service -service -service -service -service -service -service -service -service host:

  • curl https://www.google.com - 消息失败无法解析主机:www.google.com

  • 在下面执行 nsookup 命令,但接收到连接超时错误如下屏幕截图所示

设置

  • Initalises K8S群集(v1.22.9),带有1个主节点和1个Workernode, ubuntu 20.04 使用 kubeadm in AWS EC2虚拟机
  • weavenet 用于网络的插件

我跟踪了 kube-dns 日志,但 curl serviceName的请求信息 do 中的do not by kube-dns 日志 kubectl logs -namespace = kube-system -l k8s-app = kube-dns

我遵循 dns-debugging-resolution 文档,但是我无法

从阅读以前的答案中找出一个解决方案,我假设存在一些问题使用 coredns iptables ...等。但是我无法为这个问题找出解决方案。 请建议

i have 2 pods(pod1,pod2) with 2 services(service1 links pod1, service2 links pod2) in the same namespace.

Within pod1 i performed below testing. i entered into pod1 using kubectl exec ... and

  • Invoked restapi exposed in pod2 using wget pod2ipaddress - success

  • Invoked restapi exposed in pod2 using wget service2ipaddress - success

  • Invoked restapi exposed in pod2 using wget service2Name - failure with message Could not resolve host: pcgamesapp-service

  • curl https://www.google.com - failure with message Could not resolve host: www.google.com

  • Executed below nslookup command , but received connection timeout error as shown in below screenshot
    enter image description here

Setup

  • Initalised k8s cluster (v1.22.9) with 1 masterNode and 1 workerNode on ubuntu 20.04 using kubeadm in AWS EC2 virtual machines
  • weavenet plugin for networking

i tracked the kube-dns logs but the request information of curl serviceName doesnot showup in the kube-dns logs
kubectl logs --namespace=kube-system -l k8s-app=kube-dns

i followed the steps mentioned in dns-debugging-resolution documentation, but i'm not able to figure out a solution

From reading the previous answers i assume that there is some issue with coredns or iptables ...etc . But i'm unable to figure out a solution for this issue.
Please suggest

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兰花执着 2025-01-30 20:37:56

我通过另一个平台从一个名为 felix-dpg (@fdpg)的成员收到了解决方案。我添加了下面的解决方案详细信息,

其中与“必须为主节点打开哪些端口和Worker节点”有关的信息在此链接

端口详细信息在此链接

最初我不开放(6783,6784)TCP,(6783,6784)UDP的UDP端口和UDP的端口53(启用群集中的NODES中的undp port 53) )。我在这个问题中报告的问题通过

打开针对主节点开放的Weavenet和UDP 端口的端口而解决了问题。

为工人节点打开的端口

如果您对上述详细信息有任何疑问或疑虑,请告诉我。谢谢

i received the solution from a member named felix-dpg(@fdpg in stackoverflow) through another platform. i have added the solution details below

The information related to "which ports has to be opened for master node and worker node" are in this link

The weavenet port details are in this link

Initially i didnot open (6783,6784)TCP,(6783,6784)UDP ports for Weavenet and port 53 for UDP(to enable inter-communication among the nodes in the cluster). The issue which i reported in this question got resolved by opening the ports for Weavenet and UDP

Ports opened for Master node
enter image description here

Ports opened for Worker node
enter image description here

Please let me know if you have any doubts or concerns with the above details. Thank you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文