feat: deploy Wings instance for ARK SA #94
@@ -21,101 +21,95 @@ spec:
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: amd64
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: game
|
||||
operator: In
|
||||
values: [ark-sa]
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
volumes:
|
||||
- name: wings-config
|
||||
secret:
|
||||
secretName: wings-ark-sa-config
|
||||
- name: game-data
|
||||
persistentVolumeClaim:
|
||||
claimName: wings-ark-sa-data
|
||||
- name: docker-socket
|
||||
emptyDir: {}
|
||||
- name: autostart-token
|
||||
secret:
|
||||
secretName: pelican-autostart-key
|
||||
containers:
|
||||
- name: dind
|
||||
image: docker:dind
|
||||
args:
|
||||
- "--storage-driver=vfs"
|
||||
- "--iptables=false"
|
||||
image: docker:24-dind
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: docker-socket
|
||||
mountPath: /var/run/docker.sock
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: ""
|
||||
resources:
|
||||
requests:
|
||||
cpu: "500m"
|
||||
memory: "512Mi"
|
||||
memory: "1Gi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
memory: "2Gi"
|
||||
- name: wings
|
||||
image: ghcr.io/pelican-dev/wings:latest
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
export DOCKER_HOST=tcp://localhost:2375
|
||||
exec wings
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: wings-ark-sa-config
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://localhost:2375
|
||||
- name: WATCHDOG_ENABLED
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- name: wings-config
|
||||
mountPath: /etc/pterodactyl
|
||||
readOnly: true
|
||||
- name: game-data
|
||||
mountPath: /mnt/server
|
||||
- name: docker-socket
|
||||
mountPath: /var/run/docker.sock
|
||||
- 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-ark-sa-config
|
||||
key: server_uuid
|
||||
- name: WINGS_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: wings-ark-sa-config
|
||||
key: api_key
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: wings-ark-sa-config
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
- containerPort: 2023
|
||||
resources:
|
||||
requests:
|
||||
cpu: "2"
|
||||
memory: "4Gi"
|
||||
memory: "8Gi"
|
||||
limits:
|
||||
cpu: "4"
|
||||
memory: "8Gi"
|
||||
memory: "16Gi"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/container
|
||||
- name: game-autostart
|
||||
image: curlimages/curl:latest
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
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..."
|
||||
sleep 30
|
||||
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/3fd0b08d-7393-4d0f-b11c-bad5e1d1f771/power || echo "Start signal failed, retrying..."
|
||||
break
|
||||
fi
|
||||
echo "Waiting for Wings to be ready..."
|
||||
sleep 5
|
||||
done
|
||||
sleep 60
|
||||
curl -sf -X POST "https://pelican.khalisio.com/api/client/servers/3fd0b08d-7393-4d0f-b11c-bad5e1d1f771/power" \
|
||||
-H "Authorization: Bearer $(cat /etc/secrets/autostart/api_key)" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"signal":"start"}' > /dev/null 2>&1 || true
|
||||
done
|
||||
volumeMounts:
|
||||
- name: autostart-token
|
||||
mountPath: /etc/secrets/autostart
|
||||
readOnly: true
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: pelican-autostart-key
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: "64Mi"
|
||||
limits:
|
||||
cpu: "100m"
|
||||
memory: "128Mi"
|
||||
restartPolicy: Always
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "500m"
|
||||
memory: "512Mi"
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: wings-ark-sa-data
|
||||
|
||||
Reference in New Issue
Block a user