diff --git a/surf/megastructure-surf.yaml b/surf/megastructure-surf.yaml index 285c487..6ca8613 100755 --- a/surf/megastructure-surf.yaml +++ b/surf/megastructure-surf.yaml @@ -99,4 +99,72 @@ spec: targetPort: 27005 nodePort: 32005 +--- + +# ----------------------------------------------------------------------- +# MAP DOWNLOADER JOB +# ----------------------------------------------------------------------- + +apiVersion: batch/v1 +kind: Job +metadata: + name: mapsdl + namespace: surf +spec: + # Don't automatically restart on failure + backoffLimit: 2 + + # Clean up completed jobs after 1 hour + ttlSecondsAfterFinished: 3600 + + template: + spec: + restartPolicy: Never + + containers: + - name: mapsdl + image: registry.ntwl.xyz/megastructure-surf-mapsdl:latest + imagePullPolicy: Always + + # Override default dry-run command to actually download + # command: + # - "deno" + # - "run" + # - "--allow-net" + # - "--allow-read" + # - "--allow-write" + # - "--allow-env" + # - "--allow-sys" + # - "mapsdl.ts" + + env: + - name: MAPS_DIR + value: "/maps" + - name: TEMP_DIR + value: "/tmp/mapsdl" + - name: GOOGLE_APPLICATION_CREDENTIALS + value: "/app/credentials/service-account.json" + + volumeMounts: + # Mount the same PVC as cssds for maps + - name: cssds + mountPath: /maps + subPath: cstrike/maps + + # Mount credentials from secret + - name: credentials + mountPath: /app/credentials + readOnly: true + + volumes: + # Use the same PVC as the cssds deployment + - name: cssds + persistentVolumeClaim: + claimName: cssds-data + + # Mount the Google service account credentials + - name: credentials + secret: + secretName: mapsdl-credentials + --- \ No newline at end of file