3

Our cluster runs long running processes/jobs in each Pod and their states are exposed over Websocket. Since their contexts are isolated we need to make sure subsequent Websocket connections are always routed to the correct/corresponding Pod where the target process/job is being executed.

So the idea is after the process is deployed the client would be informed of its ID (name/IP) for subsequent Websocket connection to query its state - suppose sticky sessions would go out of the window here since we are talking websocket and a different client than the one deployed the process might connect to query states later…

Is there a way to ensure NGINX Ingress always directs traffic to a specific Pod by its name/IP taken from the request the URL? Like ws://xxx/channel/podname would always go to Pod with the given name? Cheers!

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20
  • Does this answer your question? [Sticky sessions on Kubernetes cluster](https://stackoverflow.com/questions/59272484/sticky-sessions-on-kubernetes-cluster) – chresse May 29 '22 at 12:47
  • Tks @chresse but as pointed out in my question dont think sticky session would work for websocket plus the connections might come from another client other than the one that deployed the job… – Bryan Huang May 30 '22 at 11:20
  • @BryanHuang : Is your issue resolved? If yes, can you provide the resolution steps you have followed and provide it as an answer for the greater visibility of the community. – Hemanth Kumar Aug 06 '22 at 14:53

0 Answers0