Skip to main content

Overview

The Agones Allocation API provides a gRPC service for allocating game servers from your fleet. This API enables matchmakers and game backends to request dedicated game server instances from available capacity, with sophisticated filtering and prioritization options.

Service Definition

The Allocation API is defined in the allocation package and provides a single primary operation:
  • Allocate: Request allocation of a game server with custom selection criteria

Key Features

Multi-Cluster Support

The Allocation API supports multi-cluster game server allocation, allowing you to manage game servers across multiple Kubernetes clusters. Enable this feature to:
  • Distribute player load across geographic regions
  • Improve latency by allocating servers closer to players
  • Implement failover strategies across clusters

Flexible Game Server Selection

Choose game servers based on:
  • Label matching: Select servers with specific labels
  • State filtering: Choose from Ready or Allocated servers
  • Player capacity: Filter by available player slots
  • Counters and Lists: Use beta features for advanced capacity management

Scheduling Strategies

Two scheduling strategies optimize your infrastructure usage:

Packed Strategy

Allocates game servers on the least number of nodes, maximizing resource efficiency by filling nodes before moving to new ones. Ideal for cost optimization.
Spreads game server allocations across available nodes to distribute load evenly. Useful for high-availability scenarios and reducing single-node failure impact.

Priority-Based Sorting

For beta CountsAndLists feature users, define custom priority rules to sort game servers before allocation. This enables sophisticated selection logic like:
  • Preferring servers with specific capacity characteristics
  • Implementing custom load balancing strategies
  • Prioritizing newer or older servers

Metadata and Actions

Customize allocated game servers by:
  • Adding labels and annotations at allocation time
  • Incrementing or decrementing counter values
  • Adding or removing list values
  • Updating capacity limits

Protocol

The Allocation API uses:
  • Protocol: gRPC with Protocol Buffers (proto3)
  • Package: allocation
  • HTTP Gateway: REST endpoints available via gRPC-Gateway
  • Transport: HTTPS for production deployments

Getting Started

To use the Allocation API:
  1. Deploy the Agones allocator service in your cluster
  2. Configure TLS certificates for secure communication
  3. Set up authentication using mTLS or other mechanisms
  4. Create an AllocationRequest with your selection criteria
  5. Call the Allocate RPC method
  6. Receive an AllocationResponse with connection details

Common Use Cases

Matchmaking Integration

Integrate with your matchmaking service to allocate dedicated game servers for matched players. The API returns connection information (IP, ports) to share with clients.

Session-Based Games

Allocate a fresh game server for each game session, apply session metadata, and track capacity using counters and lists.

Multi-Region Deployment

Use multi-cluster allocation policies to direct players to the nearest available game server, reducing latency and improving player experience.

Dynamic Scaling

Combine allocation requests with fleet autoscaling to automatically provision capacity based on demand.

Next Steps

Allocation Service

Explore the detailed gRPC service definition and RPC methods

SDK Overview

Learn about the Game Server SDK for managing server lifecycle

Build docs developers (and LLMs) love