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

Kubeadm部署的K8S集群中Socket.IO通信异常求助

Kubernetes Kubeadm集群中Socket.IO连接建立但无法事件交互的问题

在Kubeadm创建的Kubernetes集群部署应用时遇到Socket.IO通信异常:客户端与服务端已成功建立连接(服务端日志可确认),但无法进行事件交互。网上现有方案多针对GKE,不适用当前环境,求有类似经验的朋友帮忙排查。

相关环境与配置

  • 服务端Pod运行正常,可通过Ingress响应HTTP请求
  • 使用ingress-nginx v1.10.0暴露服务
  • 应用架构:Angular客户端 + Spring Boot服务端,基于Socket.IO通信
  • Service和Deployment仅包含基础配置
  • Ingress配置如下:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dpiot
  annotations:
    #nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/websocket-services: dpiot-back-service
spec:
  ingressClassName: nginx
  rules:
  - host: dpiotfront.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: dpiot-front-service
            port:
              number: 80
      - path: /socket.io/
        pathType: ImplementationSpecific
        backend:
          service:
            name: dpiot-back-service
            port:
              number: 80

集群信息

  • Kubernetes版本:1.29.0
  • 部署环境:裸金属
  • 安装方式:kubeadm
  • 宿主机OS:CentOS 7
  • CNI:Calico
  • CRI:Containerd

如需更多信息,请告知!

内容的提问来源于stack exchange,提问作者João Lucas Mendes de Oliveira

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.21 20:02:38