Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xonotic Example on Agones Site #3742

Merged
merged 15 commits into from
Apr 17, 2024
4 changes: 3 additions & 1 deletion examples/xonotic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ stdout to provide the event hooks for the SDK integration.
It is not a direct integration, but is an approach for to integrate with existing
dedicated game servers.

You will need to download the Xonotic client separately to play.
You will need to download the Xonotic client separately to play.

For detailed instructions refer to the [Agones Documentation](https://agones.dev/site/docs/examples/xonotic/).
96 changes: 96 additions & 0 deletions site/content/en/docs/Examples/xonotic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: "Deploying and Running Xonotic Server Using Agones"
linkTitle: "Xonotic"
date:
publishDate:
description: >
This Xonotic example shows setting up, deploying, and managing a Xonotic game server on a Kubernetes cluster with Agones. It uses a simple Go wrapper to connect existing game servers with Agones, making it straightforward to run games in the cloud.
---

## Prerequisite

To get started, ensure the following prerequisites are met:

- You have a running Kubernetes cluster.

- Agones is installed on your cluster. Refer to the [Agones guide](https://agones.dev/site/docs/installation/install-agones/).

- The Xonotic client downloaded for gameplay. Download it from [Xonotic](http://www.xonotic.org)
markmandel marked this conversation as resolved.
Show resolved Hide resolved

## Deploy the Agones Fleet

Deploy the fleet configuration for your Xonotic servers using the command:

```bash
kubectl apply -f fleet.yaml
```

## Verify Fleet Creation

After applying the fleet configuration, you can check to ensure that the fleet has been successfully created:

```bash
kubectl get fleets
```

Verify that the Xonotic fleet status is `Ready`, confirming that the servers are correctly set up. Further, check the status of individual pods:

```bash
kubectl get pods
```

The Xonotic server pods should be `Running`, indicating they're active and ready for connections.

## Allocate a GameServer

Allocate a GameServer from the fleet using:

```bash
kubectl apply -f <your-gameserver.yaml>
```

After applying, you can monitor the newly created GameServer resource, its status, and IP:

```bash
kubectl get gameservers
```

## Viewing GameServer Logs

For troubleshooting or to check how your game servers are running, you can look at the logs of a specific pod using:

```bash
kubectl logs -f <xonotic-game-server-pod-name>
```

## Connect to the Game Server

After allocating a GameServer from the fleet and obtaining its status and IP, you're ready to connect and play. Here’s how to use the server IP and port to join the game with the Xonotic server:

**Launch Xonotic**: Start the Xonotic client you previously downloaded.

**Multiplayer Mode**: From the main menu, select "Multiplayer".

**Server Connection**: Choose to join a server manually and input the IP and port number you obtained from the `kubectl get gameservers` command.

**Join the Game**: After entering the server details, proceed to join the server. You should now be connected to your Agones-managed Xonotic game server and ready to play.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A screenshot might be nice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've included three images, please confirm if the screenshot for joining the game is good enough?


## Cleaning Up

Post-gameplay, consider cleaning up resources:

### Remove the Fleet
Kalaiselvi84 marked this conversation as resolved.
Show resolved Hide resolved

To delete the Agones fleet you deployed, execute the following command. This will remove the fleet along with all the game server instances it manages:

```bash
kubectl delete -f fleet.yaml
```

### Remove Allocated GameServers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you delete the Fleet, the allocated GameServer goes away, so no need for the extra step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this extra step from the cleanup section


To delete the allocated game server, execute the following command.

```bash
kubectl delete -f <your-gameserver.yaml>
```
Loading