How agones-dev/agones works
Agones hosts and scales dedicated game servers on Kubernetes through custom resources and controllers. A matchmaker requests a server allocation; Agones selects a GameServer and returns connection information. In parallel, controllers reconcile GameServer and Fleet lifecycles, and FleetAutoscalers adjust capacity. The SDK sidecar exposes game-server lifecycle and status operations to game processes; metrics export operational state. The tree and README establish these capabilities, while sampled controller excerpts show selected reconciliation behavior. Some service wiring is only partially visible, so uncertain links are omitted.
Main entry points: clientset.go Kubernetes clients · controller.go Allocation endpoint · main.go Controller service · gameserver.go Agones resources
Components 20
Kubernetes API
- Agones resources
pkg/apis/agones/v1/gameserver.go - Allocation resource
pkg/apis/allocation/v1/gameserverallocation.go - Kubernetes clients
pkg/client/clientset/versioned/clientset.go
Server lifecycle
- Controller service
cmd/controller/main.go - GameServer reconciliation
pkg/gameservers/controller.go - Fleet reconciliation
pkg/fleets/controller.go - GameServerSet reconciliation
pkg/gameserversets/controller.go - Admission extensions
cmd/extensions/main.go
Allocation
- Allocator service
cmd/allocator/main.go - Allocation endpoint
pkg/gameserverallocations/controller.go - Server selection
pkg/gameserverallocations/allocator.go - Allocation processor
cmd/processor/main.go
Game runtime
- SDK sidecar server
pkg/sdkserver/sdkserver.go - SDK service entry
cmd/sdk-server/main.go
Scaling and metrics
- Fleet autoscaling
pkg/fleetautoscalers/controller.go - Metrics controller
pkg/metrics/controller.go - Metrics exporter
pkg/metrics/exporter.go
Other components
- Matchmaker
- Game process
- Kubernetes
Connections 23
- Matchmaker → Allocator service: requests server
README.md - Allocator service → Allocation endpoint: serves allocation
- Allocation endpoint → Server selection: selects server
- Allocation endpoint → Allocation processor: delegates allocation
- Server selection → Kubernetes: reads and allocates
- Allocation endpoint → Allocation resource: returns allocation
pkg/gameserverallocations/controller.go - Controller service → GameServer reconciliation: starts controllers
- Controller service → Fleet reconciliation: starts controllers
- Controller service → GameServerSet reconciliation: starts controllers
- GameServer reconciliation → Kubernetes clients: updates resources
pkg/gameservers/controller.go - Fleet reconciliation → Kubernetes clients: updates resources
pkg/fleets/controller.go - GameServerSet reconciliation → Kubernetes clients: updates resources
- GameServer reconciliation → Agones resources: updates status
pkg/gameservers/controller.go - Fleet reconciliation → GameServerSet reconciliation: manages sets
pkg/fleets/controller.go - Admission extensions → Agones resources: validates resources
- SDK service entry → SDK sidecar server: registers service
cmd/sdk-server/main.go - Game process → SDK sidecar server: uses SDK
README.md - SDK sidecar server → Kubernetes clients: updates server state
- Fleet autoscaling → Agones resources: reads fleet state
pkg/fleetautoscalers/controller.go - Fleet autoscaling → Kubernetes clients: scales fleet
- Metrics controller → Agones resources: observes resources
pkg/metrics/controller.go - Metrics controller → Metrics exporter: exports metrics
- Kubernetes → Controller service: hosts services
README.md