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

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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.