278 lines
5.6 KiB
YAML
Executable File
278 lines
5.6 KiB
YAML
Executable File
---
|
|
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: surf
|
|
|
|
|
|
# -----------------------------------------------------------------------
|
|
# VOLUMES
|
|
# -----------------------------------------------------------------------
|
|
|
|
---
|
|
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: cssds-data
|
|
namespace: surf
|
|
spec:
|
|
storageClassName: fast
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 50Gi
|
|
|
|
---
|
|
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: fastdl-maps
|
|
namespace: surf
|
|
spec:
|
|
storageClassName: fast
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 200Gi
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: cfg
|
|
namespace: surf
|
|
data:
|
|
mapcycle.txt: |
|
|
surf_fornax
|
|
surf_boreas
|
|
|
|
---
|
|
|
|
# -----------------------------------------------------------------------
|
|
# DEPLOYMENT
|
|
# -----------------------------------------------------------------------
|
|
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: cssds
|
|
namespace: surf
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: cssds
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: cssds
|
|
spec:
|
|
initContainers:
|
|
- name: fix-permissions
|
|
image: busybox
|
|
command: ['sh', '-c', 'chown -R 1000:1000 /home/steam/cssds']
|
|
volumeMounts:
|
|
- name: cssds
|
|
mountPath: /home/steam/cssds
|
|
containers:
|
|
- name: cssds
|
|
image: registry.ntwl.xyz/megastructure-surf-cssds
|
|
imagePullPolicy: Always
|
|
# command: ["sleep", "100000000"]
|
|
ports:
|
|
- containerPort: 27015
|
|
- containerPort: 27005
|
|
envFrom:
|
|
- secretRef:
|
|
name: surf
|
|
volumeMounts:
|
|
- name: cssds
|
|
mountPath: /home/steam/cssds
|
|
- name: fastdl-maps
|
|
mountPath: /fastdl/maps
|
|
readOnly: true
|
|
- name: cfg
|
|
mountPath: /home/steam/cfg
|
|
readOnly: true
|
|
volumes:
|
|
- name: cssds
|
|
persistentVolumeClaim:
|
|
claimName: cssds-data
|
|
- name: fastdl-maps
|
|
persistentVolumeClaim:
|
|
claimName: fastdl-maps
|
|
- name: cfg
|
|
configMap:
|
|
name: cfg
|
|
|
|
---
|
|
|
|
# -----------------------------------------------------------------------
|
|
# SERVICES
|
|
# -----------------------------------------------------------------------
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: cssds
|
|
namespace: surf
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: cssds
|
|
ports:
|
|
- name: game-port
|
|
protocol: UDP
|
|
port: 27015
|
|
targetPort: 27015
|
|
nodePort: 32015
|
|
- name: client-port
|
|
protocol: UDP
|
|
port: 27005
|
|
targetPort: 27005
|
|
nodePort: 32005
|
|
|
|
---
|
|
|
|
# -----------------------------------------------------------------------
|
|
# MAP DOWNLOADER
|
|
# -----------------------------------------------------------------------
|
|
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: mapsdl
|
|
namespace: surf
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: mapsdl
|
|
image: registry.ntwl.xyz/megastructure-surf-mapsdl:latest
|
|
imagePullPolicy: Always
|
|
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_WISHLIST
|
|
value: |
|
|
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
|
|
volumeMounts:
|
|
- name: fastdl-maps
|
|
mountPath: /maps
|
|
- name: credentials
|
|
mountPath: /app/credentials
|
|
readOnly: true
|
|
volumes:
|
|
- name: fastdl-maps
|
|
persistentVolumeClaim:
|
|
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
|
|
|
|
--- |