Sunday, March 3, 2024
No menu items!
HomeCloud ComputingRun your game infrastructure on GKE Autopilot to focus on player experience

Run your game infrastructure on GKE Autopilot to focus on player experience

Earlier this month, we shared Google Cloud’s strategy for live service games which outlines our focus on the three critical pillars of (1) serving players everywhere, (2) collecting and organizing game data, and (3) unlocking player and game insights. Starting today, you can run your game workloads on Google Kubernetes Engine (GKE) Autopilot — a truly automated experience in running global multiplayer game servers. This blog explores how GKE Autopilot can help you serve players globally.  

For players, games just have to work. Game developers must have underlying cloud infrastructure that is simple to operate and seamlessly scales with player traffic, so that game developers can focus on what truly matters: building great games. At Google Cloud, we are fixated on making game launches boring by making GKE Autopilot the platform-of-choice for running game workloads for scalability, reliability, and automation. 

One of the most critical components of a multiplayer game is the dedicated game server — an authoritative source of game state to which players’ clients connect to interact with the game world. These dedicated game servers have to stay up during a game session, handle many connections, and scale based on metrics such as concurrent players.

Example architecture of a global scale game

Now you can run dedicated game servers on GKE Autopilot using Agones, an open source game server orchestrator that we have been developing with the games industry. When running game servers on GKE Autopilot, Google Cloud manages the clusters for you, and you only pay for the CPU, memory, and storage that your game servers request while running. You don’t pay for unallocated nodes or system overhead, regardless of how your game servers are scheduled. 

“We use Google Kubernetes Engine to run our dedicated games servers and we are sensitive to the operating costs of clusters. We are excited to run our game servers using GKE Autopilot with Agones because it eliminates the need to manage Kubernetes node pools helping us scale our game servers and our team without scaling our costs.”—Hiroki Awata, Software Engineer, DeNA

Power-up: Game servers on GKE Autopilot 

To get started with GKE Autopilot for games, first create a GKE Autopilot cluster, then create a firewall rule to allow UDP player traffic, and install Agones using Helm.

code_block[StructValue([(u’code’, u’gcloud container clusters create-auto agones-autopilot \rn –region=us-central1 \rn –autoprovisioning-network-tags=game-server’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e8f37a718d0>)])]

Since GKE Autopilot is Kubernetes, we can create a game server fleet with the same fleet configuration yaml that we apply to any Kubernetes cluster.

code_block[StructValue([(u’code’, u’apiVersion: “″rnkind: Fleetrnmetadata:rn name: simple-game-serverrnspec:rn replicas: 5rn template:rn spec:rn ports:rn – name: defaultrn containerPort: 7777rn template:rn spec:rn containers:rn – name: simple-game-serverrn image:′), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e8f37a71750>)])]

Notice how we didn’t have to think about the number of nodes, node pools, or cluster autoscaler configuration we would need to run our game servers: we simply defined the number of game servers we wanted to run. Wasn’t that easy?

For the win: Hands-off infrastructure

GKE Autopilot is perfect for running your dedicated game servers because it is a hands-off, fully-managed Kubernetes platform that manages your cluster’s underlying infrastructure without you needing to configure or monitor – a workload level SLA backed by Google SRE. By using Agones FleetAutoscaler with GKE Autopilot, your global game server fleets automatically and dynamically scale as players flow in and out of your game – you can set it and forget it!

code_block[StructValue([(u’code’, u’apiVersion: “″rnkind: FleetAutoscalerrnmetadata:rn name: simple-game-server-autoscalerrnspec:rn fleetName: simple-game-serverrn policy:rn type: Bufferrn buffer:rn bufferSize: 2rn minReplicas: 5rn maxReplicas: 100′), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3e8f378c39d0>)])]

With traditional Kubernetes, this scaling requires resources and time for planning, right-sizing, and bin-packing. You might overprovision node pools much earlier in anticipation of scaling up and keep those node pools running longer before scaling down. All this costs money. 

Scaling game servers with GKE Autopilot makes sense because game servers are pods and Autopilot speaks in units of pods. Autopilot ensures you pay only for your running game server pods and you don’t pay for system components, operating system overhead, or unallocated capacity. According to a Forrester study, using GKE Autopilot results in up to 85% reduction in infrastructure costs and 45% improvement in developer efficiency.

noclip On: Full control, full freedom

Fully managed doesn’t have to mean vendor lock-in. Some game companies on Google Cloud run their games on cluster fleets that span across regions, on-premises, or other cloud vendors. Since Agones is open source and GKE Autopilot is based on open source Kubernetes, when serving your games with GKE Autopilot you don’t have to sacrifice portability or flexibility. Better yet, Google Cloud continues to be the largest contributor to both the Agones and Kubernetes projects allowing you to leverage our expertise and help define the roadmap to serve the next generation of games.

Pro-move: Leverage the integrations with the best of Google Cloud

The technology needed for successfully running global multiplayer games extends beyond dedicated game servers and includes matchmaking services, custom network proxies, databases, and analytics. When running game servers on GKE, these integrations are easy. For example, you can use Open Match on GKE Autopilot to scale the matchmaker with your dedicated game servers or manage player data with Cloud Spanner.

Secret Mission: Continuous delivery with Google Cloud Deploy multi-target parallel deployment

Let’s say that you want to launch your game server with new features for an upcoming global game event, region-by-region. Cloud Deploy’s new multi-target deployment capability enables you to do just that. Create GKE clusters in the regions your players are close to, group them (as targets) into multi-targets, and deploy your Agones game servers in waves. Need to first validate in a staging environment? No problem, create a staging target at the start of your progression sequence. Need an approval pause button before deployment to production? Cloud Deploy supports that too, along with multi-target rollback.

A Cloud Deploy delivery pipeline progression sequence using multi-targets

Game on

We understand that every resource that you have to spend on managing and scaling infrastructure is one less resource spent on making great games. To get started with running game servers on GKE Autopilot, learn more.

Cloud BlogRead More



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments