Skip to content

Commit c23333d

Browse files
Merge pull request #7222 from nmelehan-akamai/rc-v1.368.0
[Release] v1.368.0
2 parents 9a01f33 + a1eb26c commit c23333d

10 files changed

Lines changed: 487 additions & 146 deletions

File tree

ci/vale/dictionary.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ adoptium
2525
aes
2626
ag
2727
agentless
28+
Agones
2829
ahci0
2930
Aho
3031
ahvz
@@ -2928,6 +2929,7 @@ xml
29282929
xmpp
29292930
xms
29302931
xmx
2932+
Xonotic
29312933
XPath
29322934
XQuartz
29332935
XQuery
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Michael Archer"
3+
link: ""
4+
email: "mailto:marcher@akamai.com"
5+
description: "The Linode documentation library's profile page and submission listing for Michael Archer"
6+
---
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
---
2+
slug: set-up-a-xonotic-game-server-with-k3s-and-agones
3+
title: "Set Up a Xonotic Game Server with K3s and Agones"
4+
description: "This guide demonstrates how to install and manage server software for Xonotic using Terraform, K3s, and Agones."
5+
authors: ["Michael Archer"]
6+
contributors: ["Michael Archer"]
7+
published: 2025-03-17
8+
keywords: ['agones','xonotic','k3s','self-hosted game server']
9+
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
10+
---
11+
12+
This guide demonstrates how to install and manage software for a Xonotic server, a free and fast arena shooter game. Resources are deployed on Akamai Cloud using [Terraform](https://www.terraform.io/), an infrastructure-as-code (IaC) tool, and the game server installation is supported by K3s and Agones.
13+
14+
[K3s](https://k3s.io/) is a lightweight Kubernetes distribution. This tutorial deploys K3s on a single compute instance running the Ubuntu 20.04 LTS Linux distribution and uses it to manage your game server software. [Agones](https://agones.dev/site/) is an open-source, Kubernetes-native project specifically designed for managing dedicated game servers, and it is deployed on the K3s installation in this guide. Agones is then used to deploy and manage containers for the Xonotic server software.
15+
16+
## Before You Begin
17+
18+
1. [Install Terraform](https://developer.hashicorp.com/terraform/install) on your local machine or workstation.
19+
20+
1. Create an Akamai Cloud account if you do not already have one.
21+
22+
1. [Create a Linode personal access token](https://techdocs.akamai.com/linode-api/reference/get-started#personal-access-tokens). This token is used later by Terraform to create resources on your Akamai Cloud account.
23+
24+
## Configure Terraform
25+
26+
1. Create a directory for the Terraform project on your workstation:
27+
28+
```command {title="Your workstation"}
29+
mkdir xonotic
30+
cd xonotic
31+
```
32+
33+
1. Inside the new directory, create a Terraform configuration file named `main.tf`, and paste in the following code. This code defines a Linode instance type and sets up a firewall.
34+
35+
Be sure to replace {{< placeholder "LINODE_REGION" >}} on line 47 with a slug for a region (e.g. `us-central` for the Dallas, TX region) that's geographically closest to your location. Regions and slugs are listed on the [region availability](https://www.linode.com/global-infrastructure/availability/) page. Closer locations reduce lag/latency for players on your game server.
36+
37+
```file {title="main.tf" hl_lines="47"}
38+
# Specify the required Terraform provider
39+
terraform {
40+
required_providers {
41+
linode = {
42+
source = "linode/linode"
43+
version = ">= 1.27.0" # Ensure a version that supports metadata
44+
}
45+
}
46+
}
47+
# Define variables for sensitive information
48+
variable "linode_token" {
49+
description = "Linode API token"
50+
type = string
51+
sensitive = true
52+
}
53+
variable "root_password" {
54+
description = "Root password for the instance"
55+
type = string
56+
sensitive = true
57+
}
58+
variable "admin_ip" {
59+
description = "IPv4 address to be used to access the instance"
60+
type = string
61+
sensitive = true
62+
}
63+
64+
# Configure the Linode provider
65+
provider "linode" {
66+
token = var.linode_token
67+
}
68+
69+
# Define the cloud-init configuration
70+
data "template_file" "cloud_init" {
71+
template = <<EOF
72+
#cloud-config
73+
package_update: true
74+
package_upgrade: true
75+
76+
runcmd:
77+
- apt update -y
78+
- apt upgrade -y
79+
EOF
80+
}
81+
# Create a 8GB dedicated Linode instance in Denver
82+
resource "linode_instance" "my_instance" {
83+
label = "xonotic-game-server"
84+
region = "{{< placeholder "LINODE_REGION" >}}"
85+
type = "g6-dedicated-4"
86+
image = "linode/ubuntu20.04"
87+
root_pass = var.root_password
88+
booted = true
89+
metadata {
90+
user_data = base64encode(data.template_file.cloud_init.rendered)
91+
}
92+
}
93+
# Create a firewall to allow incoming traffic on port 22 and 7000-8000
94+
resource "linode_firewall" "my_firewall" {
95+
label = "xonotic-firewall"
96+
# Drop everything that is not covered by an explicit rule
97+
inbound_policy = "DROP"
98+
# Allow all outbound traffic
99+
outbound_policy = "ACCEPT"
100+
# Rule to allow SSH (port 22)
101+
inbound {
102+
label = "allow-ssh"
103+
action = "ACCEPT"
104+
protocol = "TCP"
105+
ports = "22"
106+
ipv4 = [var.admin_ip]
107+
}
108+
# Rule to allow custom port range (7000-8000)
109+
inbound {
110+
label = "allow-custom-ports"
111+
action = "ACCEPT"
112+
protocol = "UDP"
113+
ports = "7000-8000"
114+
ipv4 = ["0.0.0.0/0"]
115+
ipv6 = ["::/0"]
116+
}
117+
# Rule to allow Agones port 8080
118+
inbound {
119+
label = "allow-custom-ports"
120+
action = "ACCEPT"
121+
protocol = "TCP"
122+
ports = "8080"
123+
ipv4 = ["0.0.0.0/0"]
124+
ipv6 = ["::/0"]
125+
}
126+
# Associate the firewall with the instance
127+
linodes = [linode_instance.my_instance.id]
128+
}
129+
# Output the instance's IP address
130+
output "instance_ip" {
131+
value = linode_instance.my_instance.ip_address
132+
}
133+
```
134+
135+
{{< note >}}
136+
Akamai now offers an expanded set of [distributed compute regions](https://techdocs.akamai.com/cloud-computing/docs/distributed-compute-regions). Deploying in these regions is currently in [limited availability](https://techdocs.akamai.com/etp/docs/features-not-released). These regions may include locations that are closer to you than the set of core compute regions.
137+
138+
To access these regions, [contact customer support](https://techdocs.akamai.com/cloud-computing/docs/help-and-support#contact-customer-support).
139+
140+
When deploying in a distributed compute region, note that there is a different [list of supported instance types](https://techdocs.akamai.com/cloud-computing/docs/plans-distributed). The recommended distributed instance type for the deployment in this guide is a `g6-dedicated-edge-4` dedicated server. The instance type can be updated in your Terraform configuration on line 48 of the `main.tf` file under the “type” field.
141+
{{< /note >}}
142+
143+
1. In the `xonotic` directory, create a file named `terraform.tfvars` with the following code. Insert your personal access token, create a unique and complex root password, and insert your workstation's IP address (maintain the `/32` suffix after the IP).
144+
145+
```file {title="terraform.tfvars"}
146+
linode_token = "{{< placeholder "PERSONAL_ACCESS_TOKEN">}}"
147+
root_password = "{{< placeholder "LINODE_ROOT_PASSWORD">}}"
148+
admin_ip = "{{< placeholder "WORKSTATION_IP_ADDRESS">}}/32"
149+
```
150+
151+
If you’re not sure of your IP address, you can use the following command which will return your current public IP address.
152+
153+
```{title="Your workstation"}
154+
curl http://whatismyip.akamai.com
155+
```
156+
157+
{{< caution >}}
158+
Keep your `terraform.tfvars` file safe, and *never* commit it to a public repository.
159+
{{< /caution >}}
160+
161+
## Create Resources with Terraform
162+
163+
1. While inside the `xonotic` directory, initialize Terraform:
164+
165+
```command {title="Your workstation"}
166+
terraform init
167+
```
168+
169+
This command downloads the necessary [Linode Terraform provider](https://registry.terraform.io/providers/linode/linode/latest/docs).
170+
171+
1. Apply the configuration defined in the previous section of this guide:
172+
173+
```command {title="Your workstation"}
174+
terraform apply
175+
```
176+
177+
1. When prompted to confirm the changes, type `yes` and hit <kbd>Enter</kbd>. Terraform provisions your Linode instance and sets up the firewall.
178+
179+
1. Once Terraform is finished, it outputs the IP address of your new Linode instance. SSH into the instance as the root user using this IP address:
180+
181+
```command {title="Your workstation"}
182+
ssh root@{{< placeholder "LINODE_INSTANCE_IP_ADDRESS" >}}
183+
```
184+
185+
Enter the root password when prompted, which you defined in the `terraform.tfvars` file in the previous section of this guide.
186+
187+
1. Before proceeding with game server software installation, take time to [secure your new instance](https://techdocs.akamai.com/cloud-computing/docs/set-up-and-secure-a-compute-instance). Make sure to create a limited sudo user, set your timezone, configure your hostname, and harden SSH access.
188+
189+
## Install K3s
190+
191+
Once fully deployed and secured, continue your server setup while logged into your instance. First, install K3’s using the following curl command:
192+
193+
```command {title="Linode SSH session"}
194+
curl -sfL https://get.k3s.io | sh -
195+
```
196+
197+
## Install Agones on K3s
198+
199+
While logged into your instance, continue your server configuration by installing Agones.
200+
201+
1. Create a dedicated namespace for Agones, and deploy it to your K3s cluster via the installation YAML file hosted on GitHub:
202+
203+
```command {title="Linode SSH session"}
204+
kubectl create namespace agones-system
205+
kubectl apply --server-side -f https://raw.githubusercontent.com/googleforgames/agones/release-1.47.0/install/yaml/install.yaml
206+
```
207+
208+
1. Observe the new pods created by Agones:
209+
210+
```command {title="Linode SSH session"}
211+
kubectl describe --namespace agones-system pods
212+
```
213+
214+
You should see output indicating that the Agones pods are running. If the Agones pods are not running yet, wait until they are before proceeding to the next section.
215+
216+
## Install Xonotic Game Server on K3s
217+
218+
1. From your SSH session with your Linode instance, run this command to deploy a container for the Xonotic game server software using Agones:
219+
220+
```command {title="Linode SSH session"}
221+
kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.47.0/examples/xonotic/fleet.yaml
222+
```
223+
224+
1. Run this command to observe the newly deployed game server. The `watch` command will updated every 2 seconds:
225+
226+
```command {title="Linode SSH session"}
227+
watch kubectl describe gameserver
228+
```
229+
230+
Enter <kbd>Ctrl</kbd> + <kbd>C</kbd> to exit the `watch` command.
231+
232+
1. Get a list of your game servers and their IP addresses and ports:
233+
234+
```command {title="Linode SSH session"}
235+
kubectl get gs
236+
```
237+
238+
Make a note of the IP address and port, which is used to configure the Xonotic client software in the next section.
239+
240+
## Install and Configure Xonotic Client
241+
242+
1. If you don't have it already, download and install the Xonotic client for your workstation's operating system from [https://xonotic.org/](https://xonotic.org/). See the Xonotic [Forums](https://forums.xonotic.org/) and [FAQ](https://xonotic.org/faq/) for additional application support, docs, and in-game information.
243+
244+
1. Launch the Xonotic client and choose the multiplayer game mode.
245+
246+
1. Enter the IP address and port of your game server in the **Address** field of the Xonotic client UI, separated by a colon:
247+
248+
{{< placeholder "GAME_SERVER_IP_ADDRESS" >}}:{{< placeholder "GAME_SERVER_PORT" >}}
249+
250+
251+
1. Click **Join!** to join the game server.
252+
253+
## Clean Up Resources
254+
255+
Follow these steps to remove the software and resources created in this tutorial:
256+
257+
1. To remove the Xonotic game server, run this kubectl command on your Linode instance:
258+
259+
```command {title="Linode SSH session"}
260+
kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.47.0/examples/xonotic/fleet.yaml
261+
```
262+
263+
1. To remove Agones, run this kubectl command on your Linode instance:
264+
265+
```command {title="Linode SSH session"}
266+
kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.47.0/install/yaml/install.yaml
267+
```
268+
269+
1. To remove the Linode instance and firewall created by Terraform, run this Terraform command from the `xonotic` directory on your workstation
270+
271+
```command {title="Your workstation"}
272+
terraform destroy
273+
```

docs/guides/networking/vpn/strongswan-vpn-server-install/index.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ The steps in this guide are written for non-root users. Commands that require el
4444

4545
1. Use the IPsec command-line utility to create your IPsec private key. In the case of this tutorial, the private key is used to create the root certificate for StrongSwan. You can also use this key to generate other certificates.
4646

47-
sudo ipsec pki --gen --size 4096 --type rsa --outform pem > /etc/ipsec.d/private/ca.key.pem
47+
sudo ipsec pki --gen --size 4096 --type rsa --outform pem > ca.key.pem
48+
sudo mv ca.key.pem /etc/ipsec.d/private/ca.key.pem
49+
sudo chmod 600 /etc/ipsec.d/private/ca.key.pem
4850

4951
1. Create and sign the root certificate with the configurations included below. Ensure you replace the value of the `CN` configuration with your own desired name for your StrongSwan VPN server.
5052

51-
ipsec pki --self --in /etc/ipsec.d/private/ca.key.pem --type rsa --dn "CN=<Name of this VPN Server>" --ca --lifetime 3650 --outform pem > /etc/ipsec.d/cacerts/ca.cert.pem
53+
sudo ipsec pki --self --in /etc/ipsec.d/private/ca.key.pem --type rsa \
54+
--dn "CN=<Name of this VPN Server>" --ca --lifetime 3650 --outform pem | \
55+
sudo tee /etc/ipsec.d/cacerts/ca.cert.pem > /dev/null
5256

5357
In the example above, the `--lifetime 3650` configuration sets the certificate's lifetime to 3650 days or approximately ten years. The lifetime of the certificate determines when it is to be regenerated and distributed to your StrongSwan server and connected clients. You can adjust this setting to your preferred value.
5458

55-
1. Generate the StrongSwan VPN server's private certificate.
59+
1. Generate the StrongSwan VPN servers private key and save it to `/etc/ipsec.d/private/server.key.pem`. This command ensures root permissions for file creation, and suppresses terminal output.
5660

57-
ipsec pki --gen --size 4096 --type rsa --outform pem > /etc/ipsec.d/private/server.key.pem
61+
sudo ipsec pki --gen --size 4096 --type rsa --outform pem | sudo tee /etc/ipsec.d/private/server.key.pem > /dev/null
5862

5963
1. Generate the host server certificate. There are two ways to generate the certificate, however, they cannot be mixed. The two ways are as follows:
6064

@@ -64,13 +68,26 @@ The steps in this guide are written for non-root users. Commands that require el
6468
**Local Resolver Method**
6569
The example below uses a local resolver. The IPsec utility takes the server key from step 2 and uses it as an input private certificate source, and generates a resolver-based certificate. Ensure you replace the value of `CN` and `san` with your own. The `--dn “CN=<serverhost.ourdomain.tld>` is a DNS or `/etc/hosts` call that should be changed to reflect your organization's own hostname.
6670

67-
ipsec pki --pub --in /etc/ipsec.d/private/server.key.pem --type rsa | ipsec pki --issue --lifetime 3650 --cacert /etc/ipsec.d/cacerts/ca.cert.pem --cakey /etc/ipsec.d/private/ca.key.pem --dn "CN=<serverhost.ourdomain.tld>" --san="<server.ourdomain.tld>" --flag serverAuth --flag ikeIntermediate --outform pem > /etc/ipsec.d/certs/server.cert.pem
71+
sudo ipsec pki --pub --in /etc/ipsec.d/private/server.key.pem --type rsa | \
72+
sudo ipsec pki --issue --lifetime 3650 \
73+
--cacert /etc/ipsec.d/cacerts/ca.cert.pem --cakey /etc/ipsec.d/private/ca.key.pem \
74+
--dn "CN=<serverhost.ourdomain.tld>" --san="<server.ourdomain.tld>" \
75+
--flag serverAuth --flag ikeIntermediate --outform pem | \
76+
sudo tee /etc/ipsec.d/certs/server.cert.pem > /dev/null
77+
6878

6979
**Gateway Server IPv4 Address**
7080

7181
The duplicate `–san=”<server static IP address>` configuration in the command below is correct; do not omit both configurations. Replace their values with your own gateway server's IPv4 address.
7282

73-
ipsec pki --pub --in /etc/ipsec.d/private/server.key.pem --type rsa | ipsec pki --issue --lifetime 3650 --cacert /etc/ipsec.d/cacerts/ca.cert.pem --cakey /etc/ipsec.d/private/ca.key.pem --dn "CN=<server static IP address>" –san=”<server static IP address>” --san="<server static IP address>" --flag serverAuth --flag ikeIntermediate --outform pem > /etc/ipsec.d/certs/server.cert.pem
83+
sudo ipsec pki --pub --in /etc/ipsec.d/private/server.key.pem --type rsa | \
84+
sudo ipsec pki --issue --lifetime 3650 \
85+
--cacert /etc/ipsec.d/cacerts/ca.cert.pem --cakey /etc/ipsec.d/private/ca.key.pem \
86+
--dn "CN=<server static IP address>" \
87+
--san="<server static IP address>" --san="<server static IP address>" \
88+
--flag serverAuth --flag ikeIntermediate --outform pem | \
89+
sudo tee /etc/ipsec.d/certs/server.cert.pem > /dev/null
90+
7491

7592
At the end of this section, you should have generated the following files on your Ubuntu 20.04 server:
7693

0 commit comments

Comments
 (0)