4 Commits

Author SHA1 Message Date
47427e7381 Add kind cluster config example 2025-05-12 12:21:54 +02:00
53354a2113 Add gameserver example 2025-05-12 12:21:48 +02:00
efbb9d5d7e Make sure assets dir is set in example fleet 2025-05-12 12:21:35 +02:00
f8625d9fad Add player tracking to example fleet 2025-05-12 12:21:24 +02:00
3 changed files with 129 additions and 3 deletions

View File

@ -46,10 +46,9 @@ spec:
octops.io/terminate-tls: "true" octops.io/terminate-tls: "true"
octops.io/issuer-tls-name: "selfsigned-issuer" octops.io/issuer-tls-name: "selfsigned-issuer"
spec: spec:
players:
# Set initial player capacity if using PlayerTracking Alpha()
initialCapacity: 100
container: gameserver container: gameserver
players:
initialCapacity: 8
ports: ports:
- name: default - name: default
containerPort: 8081 containerPort: 8081
@ -67,6 +66,7 @@ spec:
- q3 - q3
- server - server
- --config=/config/config.yaml - --config=/config/config.yaml
- --assets-dir=/root/.q3a
- --content-server=http://127.0.0.1:9090 - --content-server=http://127.0.0.1:9090
- --agree-eula - --agree-eula
- --client-addr=0.0.0.0:8081 - --client-addr=0.0.0.0:8081

111
examples/gameserver.yaml Normal file
View File

@ -0,0 +1,111 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: server-config
data:
config.yaml: |
fragLimit: 25
timeLimit: 15m
bot:
minPlayers: 3
game:
motd: "Welcome to my Urban Terror server"
type: FreeForAll
forceRespawn: false
inactivity: 10m
server:
hostname: "quakekube"
maxClients: 12
# password: "changeme"
commands:
- addbot sarge 2
maps:
- name: ut4_uptown
type: FreeForAll
timeLimit: 10m
- name: ut4_swim
type: FreeForAll
---
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
name: urbanterror
labels:
cluster: gke-1.17
region: us-east-1
spec:
container: gameserver
players:
initialCapacity: 8
ports:
- name: default
portPolicy: Static
containerPort: 27000
hostPort: 27000
protocol: UDP
- name: client
portPolicy: Static
containerPort: 27080
hostPort: 27080
protocol: TCP
template:
spec:
containers:
- name: gameserver
imagePullPolicy: IfNotPresent
image: gitea.bp99.eu/bp99/urban-terror-server:latest
command:
- q3
- server
- --config=/config/config.yaml
- --assets-dir=/root/.q3a
- --content-server=http://127.0.0.1:9090
- --agree-eula
- --client-addr=0.0.0.0:8081
- --server-addr=0.0.0.0:27000
- --with-agones
ports:
- containerPort: 8081
readinessProbe:
tcpSocket:
port: 8081
initialDelaySeconds: 15
periodSeconds: 5
resources:
requests:
memory: "1Gi"
cpu: "0.5"
limits:
memory: "2Gi"
cpu: "1"
volumeMounts:
- name: server-config
mountPath: /config
- name: content
mountPath: /assets
- name: content-server
imagePullPolicy: Always
image: gitea.bp99.eu/bp99/urban-terror-server:latest
command:
- q3
- content
- --seed-content-url=http://content.quakejs.com
ports:
- containerPort: 9090
resources:
requests:
memory: "1Gi"
cpu: "0.5"
limits:
memory: "2Gi"
cpu: "1"
volumeMounts:
- name: content
mountPath: /assets
volumes:
- name: server-config
configMap:
name: server-config
- name: content
emptyDir: {}

15
examples/kind.yaml Normal file
View File

@ -0,0 +1,15 @@
---
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
name: ut-kind
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 27000
hostPort: 27000
listenAddress: "127.0.0.1"
protocol: UDP
- containerPort: 27080
hostPort: 27080
listenAddress: "127.0.0.1"
protocol: TCP