Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Agones (kubernetes based gameserer hoster/scaler) #334

Open
GeckoEidechse opened this issue Sep 4, 2022 · 5 comments
Open
Labels
feature request Request for a new feature/enhancement help wanted Extra attention is needed

Comments

@GeckoEidechse
Copy link
Member

Agones is a tool for deploying and scaling gameservers using Kubernetes.

Basically the idea would be to use this to allow for easy scaling of gameservers for someone using Kubernetes clusters to host their servers. Especially deploying new servers based on which gamemodes are being played is something we wanna look into. E.g. if all current Live Fire servers fill up for a regions, it should be possible to auto-deploy new ones for that specific gamemodes without having to manually monitor global state of available servers for a certain gamemode.

We'd need to do some initial research first on how it could be used to deploy new servers in case initial ones are considered full.

Of course if this tool doesn't/cannot really help us in that regard we should drop idea of adding support for it again ^^

@GeckoEidechse GeckoEidechse added feature request Request for a new feature/enhancement help wanted Extra attention is needed labels Sep 4, 2022
@cpdt
Copy link

cpdt commented Sep 5, 2022

Very interested in this for when FD becomes stable. In my opinion this would mostly be useful with the matchmaking ideas floating around, but it could certainly work within the server browser architecture.

For example, following the Reusing GameServers integration pattern:

  • A GameServer wraps a single running dedicated server instance.
  • The GameServer has the ready state while it has 0 connected players, and the allocated state while it has players. This allows Agones to downscale when there are empty servers, without stopping servers with active games.
  • bufferSize in the autoscaler config can be set to the number of empty servers that should be running at a time, meaning Agones will start servers as players join existing empty ones, and stop empty ones when players leave.
  • It would be cool if we could move players between servers after matches to merge partially full servers reducing the number of running servers, but I don't think Agones helps with this.

To that end, we would need:

  • A self-contained Docker container that can run a dedicated server (so including the game files).
  • Some way to set configuration on the container, likely a combination of k8s annotations (e.g. for server title) and config hardcoded into a Docker container.
  • Code that integrates with the Agones client SDK to send health updates, set the ready state when the server loads, and switch between allocated/ready as players leave and join. This could be built as a plugin - in fact it seems like even the current plugin API has enough functionality for this?

Agones also has an experimental Player Tracking feature, which could let it autoscale servers based on the number of empty player slots. Doesn't look like there's builtin autoscaler support for this yet though, see googleforgames/agones#1034.

@cpdt
Copy link

cpdt commented Sep 5, 2022

Some alternatives to Agones that I've found:

  • Thundernetes seems very similar, but it doesn't support a game server going from the Active state back to the StandingBy state, which means servers must be terminated when a match ends or all players leave to downscale properly.
  • Amazon GameLift is only supported on AWS. I haven't looked in-depth into features.
  • Diarkis offers autoscaling among other features, but it is not open source and is not free.

@GeckoEidechse
Copy link
Member Author

  • A self-contained Docker container that can run a dedicated server (so including the game files).

Hmm, adding them as volume is not an option? Cause while certainly doabled (*cough* *cough* nsfetch.sh), we cannot officially release a Docker container that contains game files, so that would need to be a "community effort".

This could be built as a plugin - in fact it seems like even the current plugin API has enough functionality for this?

Yet another "plugins need a rewrite first" victim xD

@cpdt
Copy link

cpdt commented Sep 5, 2022

Hmm, adding them as volume is not an option?

It doesn’t sound like it, the recommended approach is certainly to just use large Docker images. There’s a discussion on alternatives in googleforgames/agones#683.

This could just be something that each host has to set up for themselves.

Yet another "plugins need a rewrite first" victim

Is there a reason this can’t be done with the current plugin API? At least from the header file it looks like the capabilities we would need are there - checking if the game has loaded and checking the number of players.

@GeckoEidechse
Copy link
Member Author

Yet another "plugins need a rewrite first" victim

Is there a reason this can’t be done with the current plugin API? At least from the header file it looks like the capabilities we would need are there - checking if the game has loaded and checking the number of players.

Not sure about current capabilities of plugin system but the consensus was to do plugin system properly before doing more plugins / docs / etc.
On the other side, with plugin system rewrite being delayed until unknown period of time, it might be wise to just write plugin for current system already if its current state suffices for Agones SDK ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature/enhancement help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

2 participants