This repository contains the code necessary to run my Kubevirtual demo of Agones and GCGS (Google Cloud Game Servers).
- Build two GKE Clusters, green and blue, in the us-central1 region. Each has their own network.
- Create firewall rules for the gameservers to be accessible
- Create a GCGS realm named
united-states
- Create a GCGS Deployment, Config (with autoscaling), and Rollout for supertuxkart
- Install Agones and cert-manager
- Create a self-signed cluster issuer in each cluster
- Create the
gameserver
namespace
- Setup allocation services with cert issued by cert-manager
- Connect clusters to GCGS Realm using gcloud commands
- Deploy the Fleet of Gameservers (happens automatically when clusters are connected to the realm since the deployment, config, and rollout were already there)
- Generate a client cert and add it to the allow list for each allocator
- Allocate a gameserver for use by the client in each cluster
- Allocate a gameserver using multi-cluster allocation
- Connect to the gameserver, start game, end game
- Terraform - at least version
0.12.29
- reckoner - at least version
4.2.0
- gcloud cli
- jq
openssl
for generating client certificates- agones-allocator-client
kubectl
NOTE: Some of these tools can be installed via asdf and I have included a .tool-versions file in this repo
First, you'll want to change the GCP project reference to whatever GCP project you are planning to use. You can grep for agones-demo-280722
to find the references.
Then just run ./demo.sh
. This repo uses demo-magic, so you can pass some flags to it if the default behavior isn't what you want.
There is another demo script called teardown.sh
that you can run. This will de-register the clusters, delete the helm releases, and then run a terraform destroy