diff --git a/surf/megastructure-surf.yaml b/surf/megastructure-surf.yaml index 91dac6f..9cc124a 100755 --- a/surf/megastructure-surf.yaml +++ b/surf/megastructure-surf.yaml @@ -27,6 +27,21 @@ spec: --- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: fastdl-maps + namespace: surf +spec: + storageClassName: fast + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200Gi + +--- + # ----------------------------------------------------------------------- # DEPLOYMENT # ----------------------------------------------------------------------- @@ -67,10 +82,16 @@ spec: volumeMounts: - name: cssds mountPath: /home/steam/cssds + - name: fastdl-maps + mountPath: /fastdl/maps + readOnly: true volumes: - name: cssds persistentVolumeClaim: claimName: cssds-data + - name: fastdl-maps + persistentVolumeClaim: + claimName: fastdl-maps --- @@ -102,41 +123,24 @@ spec: --- # ----------------------------------------------------------------------- -# MAP DOWNLOADER JOB +# MAP DOWNLOADER # ----------------------------------------------------------------------- -apiVersion: batch/v1 -kind: Job +apiVersion: v1 +kind: Pod 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: + 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-import" - - "--allow-net" - - "--allow-read" - - "--allow-write" - - "--allow-env" - - "--allow-sys" - - "--allow-run" + - "-A" - "mapsdl.ts" env: @@ -146,27 +150,113 @@ spec: value: "/tmp/mapsdl" - name: GOOGLE_APPLICATION_CREDENTIALS value: "/app/credentials/service-account.json" + - name: MAPS_WISHLIST + value: | + surf_utopia_njv + surf_kitsune + surf_lt_omnific + surf_pantheon + surf_kitsune2 + surf_kepler + surf_anzchamps + surf_deathstar + surf_ebony + surf_fornax + surf_garden + surf_in_space volumeMounts: - # Mount the same PVC as cssds for maps - - name: cssds + - name: fastdl-maps 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 + - name: fastdl-maps persistentVolumeClaim: - claimName: cssds-data - - # Mount the Google service account credentials + claimName: fastdl-maps - name: credentials secret: secretName: mapsdl-credentials +--- + +# ----------------------------------------------------------------------- +# FASTDL +# ----------------------------------------------------------------------- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fastdl + namespace: surf +spec: + replicas: 1 + selector: + matchLabels: + app: fastdl + template: + metadata: + labels: + app: fastdl + spec: + containers: + - name: fastdl + image: registry.ntwl.xyz/megastructure-surf-fastdl + imagePullPolicy: Always + ports: + - containerPort: 80 + volumeMounts: + - name: fastdl-maps + mountPath: /srv/maps + readOnly: true + volumes: + - name: fastdl-maps + persistentVolumeClaim: + claimName: fastdl-maps + +--- + +apiVersion: v1 +kind: Service +metadata: + name: fastdl + namespace: surf +spec: + selector: + app: fastdl + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 80 + +--- + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: fastdl + namespace: surf + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + ingressClassName: haproxy + tls: + - hosts: + - fastdl.megastructure.surf + secretName: fastdl-megastructure-surf-tls + rules: + - host: fastdl.megastructure.surf + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: fastdl + port: + number: 80 + --- \ No newline at end of file