119 lines
3.3 KiB
YAML
119 lines
3.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: wings-moria
|
|
namespace: game-servers
|
|
labels:
|
|
app.kubernetes.io/name: wings
|
|
app.kubernetes.io/component: game-server
|
|
app.kubernetes.io/part-of: pelican
|
|
game: moria
|
|
spec:
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: wings-moria
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: wings-moria
|
|
game: moria
|
|
spec:
|
|
nodeSelector:
|
|
kubernetes.io/arch: amd64
|
|
containers:
|
|
- name: wings
|
|
image: ghcr.io/pelican-dev/wings:latest
|
|
env:
|
|
- name: DOCKER_HOST
|
|
value: tcp://localhost:2375
|
|
- name: WINGS_UID
|
|
value: "1000"
|
|
- name: WINGS_GID
|
|
value: "1000"
|
|
- name: WINGS_PORT
|
|
value: "8081"
|
|
- name: WINGS_API_SFTP_PORT
|
|
value: "2023"
|
|
- name: WINGS_SERVER_UUID
|
|
value: "8890d0d7-d409-4d87-99dd-f16e2adf3502"
|
|
envFrom:
|
|
- secretRef:
|
|
name: wings-moria-config
|
|
volumeMounts:
|
|
- name: docker-socket
|
|
mountPath: /var/run/docker.sock
|
|
- name: wings-data
|
|
mountPath: /var/lib/wings
|
|
- name: server-data
|
|
mountPath: /mnt/server
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: 8081
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8081
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 30
|
|
- name: dind
|
|
image: docker:24-dind
|
|
securityContext:
|
|
privileged: true
|
|
env:
|
|
- name: DOCKER_TLS_CERTDIR
|
|
value: ""
|
|
volumeMounts:
|
|
- name: docker-socket
|
|
mountPath: /var/run
|
|
- name: dind-storage
|
|
mountPath: /var/lib/docker
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- '[ -S /var/run/docker.sock ]'
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
- name: game-autostart
|
|
image: curlimages/curl:latest
|
|
env:
|
|
- name: PELICAN_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: pelican-autostart-key
|
|
key: api_key
|
|
- name: SERVER_UUID
|
|
value: "8890d0d7-d409-4d87-99dd-f16e2adf3502"
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
echo "Waiting for Wings API to be ready..."
|
|
while ! curl -sf http://localhost:8081/ready; do
|
|
sleep 2
|
|
done
|
|
echo "Wings ready. Starting game server..."
|
|
while true; do
|
|
sleep 60
|
|
echo "Checking game server status..."
|
|
done
|
|
volumeMounts:
|
|
- name: server-data
|
|
mountPath: /mnt/server
|
|
volumes:
|
|
- name: docker-socket
|
|
emptyDir: {}
|
|
- name: dind-storage
|
|
emptyDir: {}
|
|
- name: wings-data
|
|
emptyDir: {}
|
|
- name: server-data
|
|
persistentVolumeClaim:
|
|
claimName: wings-moria-data
|