Getting Started
Based on the Agones install quickstart (source 5). Commands assume a running Kubernetes cluster with
kubectlandhelmalready configured.
Prerequisites
- A running Kubernetes cluster you can reach with
kubectl. helmv3 installed and on yourPATH.- Nodes that allow inbound traffic on the HostPort range Agones uses (game clients connect to Node host ports directly).
Install
helm repo add agones https://agones.dev/chart/stable
helm repo updateA first working setup
The shortest path to a running game server is: install the Agones controller, then apply the sample GameServer and watch it reach Ready.
Install Agones into the
agones-systemnamespace.bashhelm install my-release --namespace agones-system --create-namespace agones/agonesWait for the controller Pods to come up.
bashkubectl get pods --namespace agones-systemApply the sample
GameServerfrom the repository.bashkubectl apply -f https://raw.githubusercontent.com/agones-dev/agones/main/examples/simple-game-server/gameserver.yamlWatch the game server move through its states to
Ready.bashkubectl get gameservers
Verify it works
The kubectl get gameservers output should show the game server reach STATE Ready with an ADDRESS and PORT populated. The controller writes that address during the Scheduled and Ready transitions (pkg/gameservers/controller.go:947, pkg/gameservers/controller.go:1014). You can also confirm the controller is healthy with kubectl get pods --namespace agones-system, where the controller Pod should be Running.
Where to go next
- Group management and rollouts: define a
Fleet(pkg/apis/agones/v1/fleet.go:41) instead of standalone game servers; seeexamples/fleet.yamlin the repository. - Allocation: claim a ready server with
GameServerAllocation(pkg/apis/allocation/v1/gameserverallocation.go:52); seeexamples/gameserverallocation.yaml. - Autoscaling: add a
FleetAutoscaler; seeexamples/fleetautoscaler.yaml. - Production concerns such as high availability, security hardening, and scaling are covered in the official documentation (source 5).