Home Backend Development Golang Cloud Native gaming with kruiseGame

Cloud Native gaming with kruiseGame

Sep 03, 2024 pm 02:17 PM

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

Cloud Native gaming with kruiseGame

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

Cloud Native gaming with kruiseGame

getting started with kruise-game :0

  1. 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 
Copy after login

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
Copy after login

4.go to your minikube dashboard

minikube dashboard 
Copy after login

5.you should kruise-game-system namespace, congrats you installed kruise-game

Cloud Native gaming with kruiseGame

for more info and details about kruise-game refer to kruise-game docs.

Thanks for reading,hope you enjoyed this :).

The above is the detailed content of Cloud Native gaming with kruiseGame. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1673
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
Golang vs. Python: Performance and Scalability Golang vs. Python: Performance and Scalability Apr 19, 2025 am 12:18 AM

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.

Golang and C  : Concurrency vs. Raw Speed Golang and C : Concurrency vs. Raw Speed Apr 21, 2025 am 12:16 AM

Golang is better than C in concurrency, while C is better than Golang in raw speed. 1) Golang achieves efficient concurrency through goroutine and channel, which is suitable for handling a large number of concurrent tasks. 2)C Through compiler optimization and standard library, it provides high performance close to hardware, suitable for applications that require extreme optimization.

Getting Started with Go: A Beginner's Guide Getting Started with Go: A Beginner's Guide Apr 26, 2025 am 12:21 AM

Goisidealforbeginnersandsuitableforcloudandnetworkservicesduetoitssimplicity,efficiency,andconcurrencyfeatures.1)InstallGofromtheofficialwebsiteandverifywith'goversion'.2)Createandrunyourfirstprogramwith'gorunhello.go'.3)Exploreconcurrencyusinggorout

Golang vs. C  : Performance and Speed Comparison Golang vs. C : Performance and Speed Comparison Apr 21, 2025 am 12:13 AM

Golang is suitable for rapid development and concurrent scenarios, and C is suitable for scenarios where extreme performance and low-level control are required. 1) Golang improves performance through garbage collection and concurrency mechanisms, and is suitable for high-concurrency Web service development. 2) C achieves the ultimate performance through manual memory management and compiler optimization, and is suitable for embedded system development.

Golang vs. Python: Key Differences and Similarities Golang vs. Python: Key Differences and Similarities Apr 17, 2025 am 12:15 AM

Golang and Python each have their own advantages: Golang is suitable for high performance and concurrent programming, while Python is suitable for data science and web development. Golang is known for its concurrency model and efficient performance, while Python is known for its concise syntax and rich library ecosystem.

Golang and C  : The Trade-offs in Performance Golang and C : The Trade-offs in Performance Apr 17, 2025 am 12:18 AM

The performance differences between Golang and C are mainly reflected in memory management, compilation optimization and runtime efficiency. 1) Golang's garbage collection mechanism is convenient but may affect performance, 2) C's manual memory management and compiler optimization are more efficient in recursive computing.

The Performance Race: Golang vs. C The Performance Race: Golang vs. C Apr 16, 2025 am 12:07 AM

Golang and C each have their own advantages in performance competitions: 1) Golang is suitable for high concurrency and rapid development, and 2) C provides higher performance and fine-grained control. The selection should be based on project requirements and team technology stack.

Golang vs. Python: The Pros and Cons Golang vs. Python: The Pros and Cons Apr 21, 2025 am 12:17 AM

Golangisidealforbuildingscalablesystemsduetoitsefficiencyandconcurrency,whilePythonexcelsinquickscriptinganddataanalysisduetoitssimplicityandvastecosystem.Golang'sdesignencouragesclean,readablecodeanditsgoroutinesenableefficientconcurrentoperations,t

See all articles