Troubleshooting guides and steps.
- How do I see the logs for Agones?
- I uninstalled Agones before deleted all my GameServers and now they won't delete
- I'm getting Forbidden errors when trying to install Agones
If something is going wrong, and you want to see the logs for Agones, there are potentially two places you will want to check:
-
The controller: assuming you installed Agones in the
agones-system
namespace, you will find that there is a single pod calledagones-controller-<hash>
(where hash is the unique code that Kubernetes generates) that exists there, that you can get the logs from. This is the main controller for Agones, and should be the first place to check when things go wrong.To get the logs from this controller run:
kubectl logs --namespace=agones-system agones-controller-<hash>
-
The sdk server sidecar: Agones runs a small gRPC + http server for the SDK in a container in the same network namespace as the game server container to connect to via the SDK.
The logs from this SDk server are also useful for tracking down issues, especially if you are having trouble with a particularGameServer
.- To find the
Pod
for theGameServer
look for the pod with a name that is prefixed with the name of the owningGameServer
. For example if you have aGameServer
namedsimple-udp
, it's pod could potentially be namedsimple-udp-dnbwj
. - To get the logs from that
Pod
, we need to specify that we want the logs from theagones-gameserver-sidecar
container. To do that, run the following:
kubectl logs simple-udp-dnbwj -c agones-gameserver-sidecar
- To find the
Agones uses JSON structured logging, therefore errors will be visible through the "severity":"info"
key and value.
Agones GameServers
use Finalizers
to manage garbage collection of the GameServers
. This means that if the Agones controller
doesn't remove the finalizer for you (i.e. if it has been uninstalled), it can be tricky to remove them all.
Thankfully, if we create a patch to remove the finalizers from all GameServers, we can delete them with impunity.
A quick one liner to do this:
kubectl get gameserver -o name | xargs -n1 -P1 -I{} kubectl patch {} --type=merge -p '{"metadata": {"finalizers": []}}'
Once this is done, you can kubectl delete gs --all
and clean everything up (if it's not gone already).
Some troubleshooting steps:
- Run
kubectl describe clusterrolebinding cluster-admin-binding
and make sure your email is in there. This may be case sensitive so you may need to compare it to the case you used. - In the GKE tutorial
gcloud config get-value accounts
will return a lowercase email address, so if you are using a CamelCase email, you may want to type that in manually.