feat: deploy Wings instance for ARK SA #94

Closed
gitea-admin wants to merge 6 commits from orion/auto/feat-deploy-wings-instance-for-ark-sa-1779149758378 into main
Showing only changes of commit 5e4efe948d - Show all commits
@@ -21,101 +21,95 @@ spec:
spec: spec:
nodeSelector: nodeSelector:
kubernetes.io/arch: amd64 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: containers:
- name: dind - name: dind
image: docker:dind image: docker:24-dind
args:
- "--storage-driver=vfs"
- "--iptables=false"
securityContext: securityContext:
privileged: true privileged: true
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
env: env:
- name: DOCKER_TLS_CERTDIR - name: DOCKER_TLS_CERTDIR
value: "" value: ""
resources: resources:
requests: requests:
cpu: "500m" cpu: "500m"
memory: "512Mi" memory: "1Gi"
limits: limits:
cpu: "1" cpu: "1"
memory: "1Gi" memory: "2Gi"
- name: wings - name: wings
image: ghcr.io/pelican-dev/wings:latest 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: env:
- name: DOCKER_HOST - name: DOCKER_HOST
value: tcp://localhost:2375 value: tcp://localhost:2375
- name: WATCHDOG_ENABLED - name: WINGS_Umask
value: "true" value: "0002"
volumeMounts: - name: GRPC_PORT
- name: wings-config value: "50051"
mountPath: /etc/pterodactyl - name: WINGS_API_LISTEN
readOnly: true value: "0.0.0.0:8081"
- name: game-data - name: WINGS_SFTP_LISTEN
mountPath: /mnt/server value: "0.0.0.0:2023"
- name: docker-socket - name: WINGS_SERVER_UUID
mountPath: /var/run/docker.sock 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: resources:
requests: requests:
cpu: "2" cpu: "2"
memory: "4Gi" memory: "8Gi"
limits: limits:
cpu: "4" cpu: "4"
memory: "8Gi" memory: "16Gi"
volumeMounts:
- name: data
mountPath: /home/container
- name: game-autostart - name: game-autostart
image: curlimages/curl:latest image: curlimages/curl:latest
command: command: ["/bin/sh", "-c"]
- /bin/sh args:
- -c
- | - |
while true; do while true; do
sleep 60 WINGS_READY=false
curl -sf -X POST "https://pelican.khalisio.com/api/client/servers/3fd0b08d-7393-4d0f-b11c-bad5e1d1f771/power" \ while [ "$WINGS_READY" = "false" ]; do
-H "Authorization: Bearer $(cat /etc/secrets/autostart/api_key)" \ 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" \ -H "Content-Type: application/json" \
-d '{"signal":"start"}' > /dev/null 2>&1 || true -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 done
volumeMounts: sleep 60
- name: autostart-token done
mountPath: /etc/secrets/autostart envFrom:
readOnly: true - secretRef:
name: pelican-autostart-key
resources: resources:
requests: requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "100m" cpu: "100m"
memory: "128Mi" memory: "256Mi"
restartPolicy: Always limits:
cpu: "500m"
memory: "512Mi"
volumes:
- name: data
persistentVolumeClaim:
claimName: wings-ark-sa-data