feat: deploy Wings instance for 7 Days to Die #88
@@ -0,0 +1,117 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d
|
||||||
|
namespace: game-servers
|
||||||
|
labels:
|
||||||
|
app: wings-7d2d
|
||||||
|
game: 7d2d
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: wings-7d2d
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: wings-7d2d
|
||||||
|
game: 7d2d
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/arch: amd64
|
||||||
|
containers:
|
||||||
|
- name: dind
|
||||||
|
image: docker:24-dind
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
env:
|
||||||
|
- name: DOCKER_TLS_CERTDIR
|
||||||
|
value: ""
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "1Gi"
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: "2Gi"
|
||||||
|
- name: wings
|
||||||
|
image: ghcr.io/pelican-dev/wings:latest
|
||||||
|
env:
|
||||||
|
- name: DOCKER_HOST
|
||||||
|
value: tcp://localhost:2375
|
||||||
|
- name: WINGS_Umask
|
||||||
|
value: "0002"
|
||||||
|
- name: GRPC_PORT
|
||||||
|
value: "50051"
|
||||||
|
- name: WINGS_API_LISTEN
|
||||||
|
value: "0.0.0.0:8081"
|
||||||
|
- name: WINGS_SFTP_LISTEN
|
||||||
|
value: "0.0.0.0:2023"
|
||||||
|
- name: WINGS_SERVER_UUID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: wings-7d2d-config
|
||||||
|
key: server_uuid
|
||||||
|
- name: WINGS_API_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: wings-7d2d-config
|
||||||
|
key: api_key
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: wings-7d2d-config
|
||||||
|
ports:
|
||||||
|
- containerPort: 8081
|
||||||
|
- containerPort: 2023
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "2"
|
||||||
|
memory: "8Gi"
|
||||||
|
limits:
|
||||||
|
cpu: "4"
|
||||||
|
memory: "16Gi"
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /home/container
|
||||||
|
- name: game-autostart
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
command: ["/bin/sh", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
while true; do
|
||||||
|
WINGS_READY=false
|
||||||
|
while [ "$WINGS_READY" = "false" ]; do
|
||||||
|
if curl -sf http://localhost:8081/health > /dev/null 2>&1; then
|
||||||
|
WINGS_READY=true
|
||||||
|
echo "Wings is ready, sending start signal..."
|
||||||
|
# Wait for Wings to fully initialize
|
||||||
|
sleep 30
|
||||||
|
# Send start signal to Pelican API
|
||||||
|
curl -sf -X POST \
|
||||||
|
-H "Authorization: Bearer $PELICAN_API_KEY" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"signal":"start"}' \
|
||||||
|
https://pelican.khalisio.com/api/client/servers/3a8d9bca-1274-4917-b341-67cd5168e2df/power || echo "Start signal failed, retrying..."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Waiting for Wings to be ready..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: pelican-autostart-key
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "256Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "512Mi"
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: wings-7d2d-data
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d-config
|
||||||
|
namespace: game-servers
|
||||||
|
spec:
|
||||||
|
refreshInterval: 1h
|
||||||
|
secretStoreRef:
|
||||||
|
name: vault-secret-store
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
target:
|
||||||
|
name: wings-7d2d-config
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
- secretKey: config
|
||||||
|
remoteRef:
|
||||||
|
key: secret/data/Talos Cluster/wings/7d2d
|
||||||
|
property: config
|
||||||
|
- secretKey: api_key
|
||||||
|
remoteRef:
|
||||||
|
key: secret/data/Talos Cluster/wings/7d2d
|
||||||
|
property: api_key
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d
|
||||||
|
namespace: game-servers
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
tls:
|
||||||
|
secretName: wings-7d2d-tls
|
||||||
|
certResolver: letsencrypt
|
||||||
|
routes:
|
||||||
|
- match: Host(`wings-7d2d.khalisio.com`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: wings-7d2d-api
|
||||||
|
port: 8081
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d-data
|
||||||
|
namespace: game-servers
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 50Gi
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d-api
|
||||||
|
namespace: game-servers
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: wings-7d2d
|
||||||
|
ports:
|
||||||
|
- name: api
|
||||||
|
port: 8081
|
||||||
|
targetPort: 8081
|
||||||
|
protocol: TCP
|
||||||
|
- name: sftp
|
||||||
|
port: 2023
|
||||||
|
targetPort: 2023
|
||||||
|
protocol: TCP
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: wings-7d2d-game
|
||||||
|
namespace: game-servers
|
||||||
|
annotations:
|
||||||
|
metallb.io/address-pool: "default"
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
loadBalancerIP: 10.4.4.203
|
||||||
|
selector:
|
||||||
|
app: wings-7d2d
|
||||||
|
ports:
|
||||||
|
- name: udp
|
||||||
|
port: 26900
|
||||||
|
targetPort: 26900
|
||||||
|
protocol: UDP
|
||||||
|
- name: tcp
|
||||||
|
port: 26900
|
||||||
|
targetPort: 26900
|
||||||
|
protocol: TCP
|
||||||
Reference in New Issue
Block a user