Nathan Rashleigh 0d2260f983 peace on earth
2026-02-10 13:11:31 +11:00

269 lines
5.6 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: surf
# -----------------------------------------------------------------------
# VOLUMES
# -----------------------------------------------------------------------
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cssds-data
namespace: surf
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fastdl-maps
namespace: surf
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
# -----------------------------------------------------------------------
# ENV (create/update with: just env)
# -----------------------------------------------------------------------
# -----------------------------------------------------------------------
# CSSDS
# -----------------------------------------------------------------------
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cfg
namespace: surf
data:
mapcycle.txt: |
surf_anzchamps
surf_boreas
surf_deathstar
surf_ebony
surf_fornax
surf_garden
surf_in_space
surf_kepler
surf_kitsune
surf_kitsune2
surf_lt_omnific
surf_pantheon
surf_utopia_njv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cssds
namespace: surf
spec:
replicas: 1
selector:
matchLabels:
app: cssds
template:
metadata:
labels:
app: cssds
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
initContainers:
- name: fix-permissions
image: busybox
securityContext:
runAsUser: 0
command: ['sh', '-c', 'chown -R 1000:1000 /home/steam/cssds']
volumeMounts:
- name: cssds-data
mountPath: /home/steam/cssds
containers:
- name: cssds
image: megastructure-surf-cssds:local
imagePullPolicy: Never
ports:
- containerPort: 27015
protocol: TCP
- containerPort: 27015
protocol: UDP
- containerPort: 27020
protocol: UDP
envFrom:
- secretRef:
name: surf
volumeMounts:
- name: src
mountPath: /home/steam/src
- name: cssds-data
mountPath: /home/steam/cssds
- name: fastdl-maps
mountPath: /fastdl/maps
readOnly: true
- name: cfg
mountPath: /home/steam/cfg
readOnly: true
volumes:
- name: src
hostPath:
path: /run/desktop/mnt/host/c/Users/ntr/code/surf_megastructure/src/cssds
- name: cssds-data
persistentVolumeClaim:
claimName: cssds-data
- name: fastdl-maps
persistentVolumeClaim:
claimName: fastdl-maps
- name: cfg
configMap:
name: cfg
---
apiVersion: v1
kind: Service
metadata:
name: cssds
namespace: surf
spec:
type: LoadBalancer
selector:
app: cssds
ports:
- name: game-tcp
protocol: TCP
port: 27015
targetPort: 27015
- name: game-udp
protocol: UDP
port: 27015
targetPort: 27015
- name: tv
protocol: UDP
port: 27020
targetPort: 27020
# -----------------------------------------------------------------------
# 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: megastructure-surf-fastdl:local
imagePullPolicy: Never
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:
type: LoadBalancer
selector:
app: fastdl
ports:
- name: http
port: 8080
targetPort: 80
# -----------------------------------------------------------------------
# MAP DOWNLOADER (run manually: kubectl apply, then delete when done)
# -----------------------------------------------------------------------
---
apiVersion: v1
kind: Pod
metadata:
name: mapsdl
namespace: surf
spec:
restartPolicy: Never
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: mapsdl
image: megastructure-surf-mapsdl:local
imagePullPolicy: Never
command: ["deno", "run", "-A", "mapsdl.ts"]
env:
- name: MAPS_DIR
value: "/maps"
- name: TEMP_DIR
value: "/tmp/mapsdl"
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/app/credentials/service-account.json"
- name: MAPS_LIST_FILE
value: "/cfg/mapcycle.txt"
volumeMounts:
- name: fastdl-maps
mountPath: /maps
- name: credentials
mountPath: /app/credentials
readOnly: true
- name: cfg
mountPath: /cfg
readOnly: true
volumes:
- name: fastdl-maps
persistentVolumeClaim:
claimName: fastdl-maps
- name: credentials
hostPath:
path: /run/desktop/mnt/host/c/Users/ntr/code/surf_megastructure/src/mapsdl/credentials
- name: cfg
configMap:
name: cfg
---