Websocket inaccessible on kubernetes deployment

Your k8s deployment (GitHub - TykTechnologies/tyk-kubernetes: Tyk + Kubernetes integration (guide).) does not correctly expose the port 5000 for enabling websocket connections. However, even if you expose the port 5000 (both on the pod and on the service), the websocket connection still fails, because it expects to be able to connect on the same domain as the dashboard, on port 5000. While it is possible to configure the port (notifications_listen_port), what we also need is the ability to configure the host (notifications_listen_host), so we can expose the websocket on a different domain using a different ingress.

See this issue for more details: Configure port 5000 · Issue #7 · TykTechnologies/tyk-kubernetes · GitHub

1 Like

I’m not sure why the WebSocket functionality needs to be on a different port at all. WebSockets were designed to be able to be used on the same port as HTTP traffic (per RFC 6455 - The WebSocket Protocol):

1.3. Opening Handshake
The opening handshake is intended to be compatible with HTTP-based server-side software and intermediaries, so that a single port can be used by both HTTP clients talking to that server and WebSocket clients talking to that server.

That’s all fine, but with ingress, you can only expose port 80/443, right?