You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kubernetes中Main Pod无法与Other Pod通信问题求助

问题:Main Pod无法访问Other Pod的端点

我有两个Pod:Main Pod和Other Pod。Main Pod的一个端点需要调用Other Pod的端点获取结果。两个Pod均配置了ClusterIP类型的Service,且Main Pod还配置了Ingress。目前Main Pod无法连接到Other Pod的指定端点。

从截图可见,/端点可正常工作,但/other端点请求失败。

相关配置文件

main-service.yaml

# main-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: main-service
  labels:
    name: main-service-label
spec:
  selector:
    app: main # label selector of pod, not the deployment
  type: ClusterIP
  ports:
  - port: 8001
    protocol: TCP
    targetPort: 8001

other-service.yaml

# other-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: other-service
  labels:
    name: other-service-label
spec:
  selector:
    app: other # label selector of pod, not the deployment
  type: ClusterIP
  ports:
  - port: 8002
    protocol: TCP
    targetPort: 8002

备注

  • 使用kubectl exec进入Other Pod后,可正常curl访问Main Pod,但反向无法实现,不清楚问题所在。
  • 所有Pod和Service均位于default命名空间。

内容的提问来源于stack exchange,提问作者harshraj22

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 21:10:35