1

Trying to host an app, specifically Foundry VTT, on my k8s cluster. It connects fine, but websockets (any url starting with /socket.io/ are giving me a 400 error.

Googling how to enable websocket support, it seems I just need to add the proxy send/read timeout and set it to a higher value, which I did.

I've tried adding nginx.org/websocket-service annotation, but that didn't work.

 

Nginx version: Helm chart ingress-nginx-3.20.1; app version 0.43.0

My ingress.yml:

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foundry
  labels:
    app: foundry
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive"
    #nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: '30'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '3600'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '3600'
    nginx.ingress.kubernetes.io/client-max-body-size: 512M
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
spec:
  tls:
    - hosts:
        - rpg.example.com
      secretName: foundry-tls
  rules:
    - host: rpg.example.com
      http:
        paths:
          - path: /
            backend:
              serviceName: foundry
              servicePort: http
cclloyd
  • 583
  • 1
  • 13
  • 24
  • Hi @cclloyd, if I understand correctly if you use `ingress-nginx-3.20.1` helm chart from https://artifacthub.io/, you use kubernetes version of ingress. `nginx.org/websocket-service` is annotation from nginx-inc version of ingress. More about it [here](https://www.nginx.com/blog/wait-which-nginx-ingress-controller-kubernetes-am-i-using/). As for the issue could you provide the logs output from your nginx pod? Also there is kubernetes ingress [documentation](https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/#websockets) about that, could you cerify the important part please? – Jakub Jan 18 '21 at 11:52
  • @cclloyd have you managed to solve your issue? According to the documentation from previous comment there should be no additional configuration required for the websocket support. – Dawid Kruk Apr 19 '21 at 18:16
  • @cclloyd, looks like an issue with annotations. I hope your problem has been resolved since you posted the question a long time ago. Can you post and accept the procedure followed as a solution? – Chandra Kiran Pasumarti Apr 04 '22 at 05:41

0 Answers0