PlayStation is testing running real-time gameservers from the cloud using Kubernetes – a challenging step given that Kubernetes “pods”, or small units of computing, tend to be ephemeral and have the potential if automatically stopped and relaunched to ruin someone’s gaming experience (which needs to be consistent.)
So, how is it doing it?
At a talk at Kubecon on April 19, Joe Irving, a senior DevOps engineer at PlayStation, suggested that although the challenge was complex, the answer, in a sense, was simple: Agones. That’s an open source project initially born in 2017 as a collaboration between Ubisoft and Google Cloud, with the aim of developing a “a turn-key solution for running, scaling and orchestrating multiplayer dedicated game servers on top of Kubernetes.”
Irving set the scene nicely for why gameservers matter and what they do.
A gameserver acts as a single source of truth for a multiplayer game: if one player crashes their car into a wall, the gameserver “understands” that and feeds that action to all other players connected to it; synchronising all of their respective actions and feeding them back to all players connected to it so they have the shared experience. Get it wrong though and players get booted off, or drive straight at a wall when they steered right.
As Irving put it: “Some of you may be thinking that it sounds like a terrible idea to run this in Kubernetes and out of the box it won’t work effectively” – with the DevOps engineer pointing to challenges around how Kubernetes allocates resources, e.g. terminating under-used units of compute resource using the cluster autoscaler, or fluidly adjusting resource during for example a deployment roll-out or patch update; keeping things running, broadly, but breaking up and reallocating compute resource dynamically to support that.
“Pod termination happens all the time” as he put it. “You don’t want that to happen if gamers are playing!”
Agones tackles this by letting users “add extra resources that don't exist by default, using custom resource definitions” (Agones has an FAQ with answers to some common questions about deployment here.)
Asked by The Stack discreetly at the end of a standing room-only session in Amsterdam how many gameservers PlayStation had running in production on Kubernetes + Agones (something the talk rather studiously avoided) Irving told us that the answer was, indeed, “none” but that PlayStation had hopes of making the shift.
Why Agones/why do this? The library for hosting, running and scaling dedicated game servers on Kubernetes can help “lower development and operational costs for hosting, scaling and orchestrating multiplayer game servers,” be run anywhere (cloud, on-premise, local machine, etc.) and “any game server that can run on Linux can be hosted and orchestrated on Agones – in any language, or set of dependencies” the project’s leaders say.
All your scalable, flexible, cloud-native goodness but for gameservers, in short. (And with the gaming industry pipped by PwC to be worth $321 billion by 2026 and everyone from Netflix to Amazon bundling more games onto their platforms, cloud providers are keen to help support infrastructure for game streaming and multi-player game-handling compute workloads: There’s gold in them thar hills; if also still a few bugs in them.)
Irving told The Stack that PlayStation was really “finding a pattern that works so that we can accelerate game development as we make more multiplayer games…” Existing PlayStation gameserver deployment meanwhile varies wildly by title, he added: “Some are on-prem, some are in the cloud, all using custom solutions…”
If PlayStation nails the gamerserver-on-Kubernetes + Agones brief (and Irving’s team is hiring for help to get this vision over the line) more multi-player games will be able to hit the market at a greater cadence.
That’s good news for both game developers and gamers. Watch this space.