Node.js multiplayer website - need help switching from App Platform to Kubernetes

I’ve been using the App Platform for a bit and have been really liking them, but I’ve been meaning to switch to something more scalable like Kubernetes.

I’ve read a lot about it and just have a couple questions before I ultimately make the leap.

My setup uses a master process which spawns many worker processes. The workers are the “game servers” - where all the game logic happens. The master process just handles user management, this process knows where each user is when I need to connect two players together who are on different game servers.

  1. When I make Pods, should they run the “master” process which spawns a bunch of workers, or should one Pod just run one of the “workers”?

  2. How will Pods communicate with one another? It seems like Redis is required somehow, but I’m not too sure. (and if Redis IS required, would DigitalOcean Managed Redis make it easier, or would just installing Redis be better?)

  3. I use Nginx as a reverse proxy that connects users to one of the “workers” in my setup. Is there a strategy to connect users to the Pod with the least load? Or at least to a random Pod?

If you could help it would mean a lot, thank you for reading :D

Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

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.

for #1, I think replacing the master process with a “master Pod” would work, then just have Kubernetes automatically scale the “workers”. What I’m not sure about is how you would detect when a new worker is created/deleted.