Answer the question
In order to leave comments, you need to log in
How to set up addressing and deployment of game servers in kubernetes?
I have a kubernetes cluster. It has 2 types of entities: api servers and game servers. All requests from users go to the api server. In turn, the api servers must contact the game servers for all requests related to games. Games are evenly distributed among game servers. Accordingly, when a user request is related to a specific game, the api server must redirect this request to a specific game server on which this game is running.
In this regard, I have a couple of questions:
1. How to set up addressing between api and game servers in kubernetes? How to let the api server know where he needs to send a request related to a particular game? Where and in what format is it better to store information about what games are running on which game servers?
2.How to ensure a silent update of game servers so that when updating, the old game servers continue to work until all the current games on them run out, and all new games are launched on the new servers?
Answer the question
In order to leave comments, you need to log in
1. You can use service discovery, for example, Consul
2.a I would think about making the server stateless - store the state in an external database (eg Redis) and pick up the state from it with a new instance during Rolling Update.
2.b Another option is Gracefull Shutdown . By intercepting the signal and setting a sufficiently long grace-period, you can ensure that the server waits for the session to end and only then ends
1. In my opinion, the simplest thing is to run each game as a service in K8S, and then you don't need to store anything - K8S does it itself.
2. Use "StrategyType: RollingUpdate" deployment https://kubernetes.io/docs/concepts/workloads/cont...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question