What is kruise-game ?
kruise-game is an opensource project under openkruise that aims to bring cloud native transformation for gaming workloads aka game servers.
but what are game servers really ?
games servers are basically virtual machines or containers that handle the core functionalities in the backend of PVP multiplayer online game
below I have shown basic game server architecure used by modern PvP online games
why do we really need kruise-game. aren't default k8s resources enough for gaming workloads ?
modern PvP games are getting increasingly complex they require multiple game servers to handle different kind of services for example.
your modern PvP game like valorant need game servers for lobbying ,matchmaking,and the one that runs actualy game logic and manages game state.Handling so many game servers is big task and cant be done manually. So what now ?
well we have got kubernetes to rescue.K8s with it's automated operation and mangement
capabilities can handle this burden for Us,just deploy your game server image and we are done right ?. Not really
I wish it was this easy.The problem is your not deploying your usual stateless web app here.Game servers are different and their requirements are different.k8s default resources are good for stateless apps but gameservers have a more complex lifecycle and they are stateful also their network requirements are different.
first of all game servers need direct lossless connection to clients(udp connection),for this we need fixed Ip addresses of pods,k8s pods IP is changed during deletion,scaling.
also there is lack of control you have over pods if use them for game servers ,there is a thing called rolling update where you update some instances of game servers to test the update and gradually roll out to other instances to prevent downtime,K8s scheduler doesn't know you are working with game servers it will update pods in random manner,basically you have no control over the update strategy of your game servers.SO you have little to no flexibility over game server updates.
To mitigate these issues kruise-game defines two custom Resource designed specifically for game server workloads gameServer and gameserverSet
gameServer:Refers to the abstraction of O&M and management operations on a specified game server. It is mainly used for O&M and management operations such as update sequence control, state control of the game server, and network changes of the game server.
gameServerSet:Refers to the abstraction of lifecycle management for a group of game servers. It is mainly used for lifecycle control such as replica number management and game server launch.
features that kruise-game provides for management of game servers:-
Hot update based on images and hot reload of configurations
Update, deletion, and isolation of specified game servers
Multiple built-in network models (fixed IP address and port, lossless direct connection, and global acceleration)
Auto scaling
Automated O&M (service quality)
Independent of cloud service providers
Complex game server orchestration
Below image shows kruise-game deploymment architecture on k8s
getting started with kruise-game :0
- getting a k8s cluster and helm
you would need a k8s cluster for kruise-game,easiest way to get k8s cluster is to get minikube in your machine,also make sure you have helm installed in your machine.
2.start minikube
minikube start
3.use helm to install kruise-game
#kruise-game relies on openkruise so you need to install openkruise first
# Firstly add openkruise charts repository if you haven't do this.
$ helm repo add openkruise https://openkruise.github.io/charts/
# [Optional]
$ helm repo update
# Install the latest version.
$ helm install kruise openkruise/kruise --version 1.6.3
#now instakk kruise-game
$ helm install kruise-game openkruise/kruise-game --version 0.8.0
4.go to your minikube dashboard
minikube dashboard
5.you should kruise-game-system namespace, congrats you installed kruise-game
for more info and details about kruise-game refer to kruise-game docs.
Thanks for reading,hope you enjoyed this :).
Top comments (0)