Prerequisite Knowledge

Prerequisites before interacting with the API.

A few requirements must be satisfied in order to guarantee a successful installation and usage of the Octops Discover service.

Knowledge

We assume that you have some familiarity with Kubernetes and Agones.

Useful Links:

Requirements

  • A running Kubernetes Cluster.
  • Valid KUBECONFIG and permissions to run commands using kubectl against the chosen cluster.
  • Agones 1.28 or higher running within the cluster.
  • A valid OCTOPS_API_TOKEN to be used by the Octops Agent.
  • HTTP Client like curl, https://www.postman.com/product/rest-client/ or https://insomnia.rest/. Any other client that you are familiar will work too.

Game Server Lifecycle

The consistence of the data exposed by the Octops Discover API relies on the events being published from the cluster(s) where the game servers are running alongside with the Octops Agent.

There are different reasons why a game server state changes, some are controlled by the game owner and others are not. Check the official Agones game server state diagram for a better understanding.

Possible events that trigger a game server change:

  • Game server changes from Scheduled to Ready
  • Game server is allocated and moves to an Allocated state
  • Using the Agones SDK
    • Ready()
    • Shutdown()
    • SetLabel()
    • SetAnnotation()
    • Allocate()
    • Reserve()
    • Alpha().SetCapacity()
    • Alpha().PlayerConnect()
    • Alpha().PlayerDisconnect()

GameServers and Fleets

Make sure you have a GameServer or a Fleet manifest prepared and it can deploy a health version of your game.

# Example of a Fleet manifest
# https://agones.dev/site/docs/reference/fleet/

apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
  name: fleet-test
  labels:
    # TIP: If you are running multi-cluster set a label that can identify the cluster
    # hosting the Fleet instead of a generic name.
    cluster: gke-1.24
    region: us-east-1
spec:
  replicas: 5
  template:
    metadata:
      labels:
        cluster: gke-1.24
        region: us-east-1
    spec:
      health:
        disabled: false
      ports:
        - name: default
          containerPort: 8010
          protocol: TCP
      template:
        spec:
          containers:
            - name: gameserver
              imagePullPolicy: Always
             image: gcr.io/agones-images/udp-server:0.28
              resources:
                requests:
                  memory: "1Mi"
                  cpu: "0.02m"
                limits:
                  memory: "64Mi"
                  cpu: "2m"