I have a deployment running inside my k8s cluster that uses Socket.io, but external WebSocket traffic doesn’t seem to be getting to it.
I’m using nginx ingress controller with cert-manager, which works fine for normal HTTPS traffic. With this setup, SSL termination is with nginx and the certificates live in the cluster.
I’ve seen in the docs and elsewhere that I need to switch the load balancer protocol to HTTP instead of TCP to get WebSockets to work. However, doing that breaks SSL for me. This is because the DigitalOcean load balancer has two options:
Is there a way to continue to use nginx ingress controller and cert manager with WebSockets?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Looks like a user put a nice write-up for this over on Medium that you may find helpful:
https://medium.com/swlh/how-to-use-web-sockets-socket-io-with-digital-ocean-load-balancers-and-kubernetes-dok8s-with-e4dd5531c67e
I got this working in the end, terminating the SSL at nginx (passthrough on the load balancer) and allowing it to reverse-proxy the data to the apps with sticky sessions. For anyone else stuck on this, here are my manifests - hope they help:
nginx-ingress-loadbalancer-service.yaml
ingress.yaml
Did you ever get a resolution to this, I am stuck with exactly the same issue.