为什么无法从kubernetes中的另一个节点访问服务

为什么无法从kubernetes中的另一个节点访问服务,kubernetes,Kubernetes,今天我的pod无法启动并显示此错误: 2021-04-22 12:41:26.325 WARN 1 --- [ngPollService-1] c.c.f.a.i.RemoteConfigLongPollService : Long polling failed, will retry in 64 seconds. appId: 0010010006, cluster: default, namespaces: TEST1.RABBITMQ_CONFIG_REPORT+TEST1.RAB

今天我的pod无法启动并显示此错误:

2021-04-22 12:41:26.325  WARN 1 --- [ngPollService-1] c.c.f.a.i.RemoteConfigLongPollService    : Long polling failed, will retry in 64 seconds. appId: 0010010006, cluster: default, namespaces: TEST1.RABBITMQ_CONFIG_REPORT+TEST1.RABBITMQ-CONFIG+application+TEST1.EUREKA+TEST1.DATASOURCE-DRUID+TEST1.COMMON_CONFIG+TEST1.REDIS-CONFIG, long polling url: null, reason: Get config services failed from http://service-apollo-config-server-test-alpha.sre.svc.cluster.local:8080/services/config?appId=0010010006&ip=172.30.184.11 [Cause: Could not complete get operation [Cause: Connection refused (Connection refused)]]
此错误告诉我此pod无法访问配置服务,从配置中心获取配置失败,因此无法启动。然后我登录到另一个节点(work fine node)pod,并将配置pod卷曲如下:

curl http://service-apollo-config-server-test-alpha.sre.svc.cluster.local:8080
很好。因此,配置服务是正常的。现在,我在问题节点pod中运行相同的命令:

bash-4.4# curl http://service-apollo-config-server-test-alpha.sre.svc.cluster.local:8080
curl: (7) Failed to connect to service-apollo-config-server-test-alpha.sre.svc.cluster.local port 8080: Connection refused
bash-4.4# curl http://service-apollo-config-server-test-alpha.sre.svc.cluster.local:8080
我在problem node中按如下方式ping配置节点,效果很好:

ping service-apollo-config-server-test-alpha.sre.svc.cluster.local
然后,我从问题节点使用
nmap
扫描配置节点:

bash-4.4# nmap service-apollo-config-server-test-alpha.sre.svc.cluster.local
Starting Nmap 7.70 ( https://nmap.org ) at 2021-04-22 12:45 CST
Nmap scan report for service-apollo-config-server-test-alpha.sre.svc.cluster.local (10.254.82.131)
Host is up (0.000010s latency).
Not shown: 996 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
3306/tcp open  mysql
8443/tcp open  https-alt
没有找到8080端口。网络似乎正常,但无法从节点访问服务。为什么问题节点pod无法访问配置服务?我应该怎么做才能发现问题并解决它?我在使用pod ip的问题节点上发现它可以工作,例如:

    # pod ip access works
    curl 172.30.112.2:11025
    # service ip failed 
    curl 10.254.94.209:11025
    # service name failed
    curl soa-illidan-superhub.dabai-fat.svc.cluster.local:11025

最后,我在CentOS 7.6中发现kube代理进程已退出,使用以下命令启动:

systemctl start kube-proxy

解决它。

你能发布
k get svc service with problems-oyaml
k get pod with problems-oyaml
的结果吗?为了更好地了解情况,我最终发现问题节点中的kube代理进程已停止,我启动了kube代理,问题解决了@AndD@Dolphin,你能把它贴出来作为答案吗?