helm部署JumpServer登陆web界面提示连接websocket失败

 jumpserver版本 v3.10.1 【社区版】

解决方法 ,修改ingress规则即可

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    compute-full-forwarded-for: "true"
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: jms-k8s
    meta.helm.sh/release-namespace: jumpserver
    nginx.ingress.kubernetes.io/proxy-body-size: "4096m"       #这个要加,上传文件大小,不然文件都无法上传
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"     #这是解决websocket附带的方法
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"   #这是解决websocket附带的方法
    nginx.ingress.kubernetes.io/server-snippets: |                    #加上底下这些
      location / {
        proxy_set_header Upgrade "websocket";                       #最重要
        proxy_http_version 1.1;                 #最重要
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header Connection "Upgrade";                      #最重要
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    use-forwarded-headers: "true"
  generation: 1
  labels:
    app.kubernetes.io/instance: jms-k8s
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: jumpserver
    app.kubernetes.io/version: v3.10.1
    helm.sh/chart: jumpserver-3.10.1
  name: jms-k8s-jumpserver-ingress
  namespace: jumpserver
spec:
  rules:
  - host: jump.wbes.link
    http:
      paths:
      - backend:
          service:
            name: jms-k8s-jumpserver-jms-web
            port:
              number: 80
        path: /
        pathType: Prefix

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值