Installation

Install the Octops Agent and start publishing game servers details.

The setup is one step process that will deploy:

  • Namespace named octops-system
  • Required RBAC roles for the agent
  • The agent Deployment

Check the Prerequisite Knowledge before proceeding.

Deploying the Agent

Configure the OCTOPS_API_TOKEN and then run the install script on every Kubernetes cluster hosting game servers. Go to https://dashboard.octops.dev to generate your key.

export OCTOPS_API_TOKEN="[YOU_OCTOPS_API_TOKEN]"
curl -fsS https://get.octops.dev/install.sh | sh -

The following output should be expected

namespace/octops-system created
serviceaccount/octops-agent created
clusterrole.rbac.authorization.k8s.io/octops-agent created
clusterrolebinding.rbac.authorization.k8s.io/octops-agent created
secret/octops-secret created
deployment.apps/octops-agent created
  • Keep only one instance of the agent running. More than one replica will not have any positive impact on performance.
  • Events are flushed to the Octops Cloud on a interval basis (defaults to 35s). They are handled concurrently by the number of workers set by the flag --max-concurrent-workers.
  • The -v flag makes the output verbose. This is recommended for initial debugging and possible troubleshooting.
  • The default settings have been tested on fleets bigger than 15K concurrent game servers.

Verify the installation

Check logs from the agent, if the installation completed successfully errors should no be expected.

# check the agent logs
kubectl -n octops-system logs \
-f $(kubectl -n octops-system get pod -l app=octops-agent -o=jsonpath='{.items[*].metadata.name}')
# logs output
time="2023-02-04T14:41:13Z" level=info msg="controller created for resource of type v1.GameServer" controller_type=v1.GameServer source=controller
time="2023-02-04T14:41:33Z" level=info msg="running 3 workers" source=agent

Events are published on an interval basis and the log message shows some details like the batch size, that is the number of game servers published in one single request. Those batches can contain up to 1000 game servers each and they are published concurrently.

# publishing events
time="2023-02-04T14:42:20Z" level=info msg="published events.octops.io/batch" batch=1000 event_time="2023-02-04T14:42:20Z" latency_ms=30 worker=1
time="2023-02-04T14:42:21Z" level=info msg="published events.octops.io/batch" batch=1000 event_time="2023-02-04T14:42:21Z" latency_ms=30 worker=2
time="2023-02-04T14:42:22Z" level=info msg="published events.octops.io/batch" batch=250 event_time="2023-02-04T14:42:22Z" latency_ms=26 worker=3

Plug & Pay

  • The Octops agent can be installed on clusters which already have GameServers or Fleets resources deployed. No need to delete or redeploy your manifests.
  • It does not require restarts or pod deletion after a new Fleet is pushed to Kubernetes or a GameServer is created.
  • The Octops agent reacts to events of type OnAdd, OnUpdate and OnDelete and keeps watching the game server during all its lifecycle.

What is next?

  • Check the Examples to learn how to query game servers from the Discover API.