quorate/services/minecraft/k8s/deployment.yaml

199 lines
5.9 KiB
YAML
Raw Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: minecraft
namespace: minecraft
labels:
app.kubernetes.io/name: minecraft
app.kubernetes.io/instance: skies
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: minecraft
app.kubernetes.io/instance: skies
template:
metadata:
labels:
app.kubernetes.io/name: minecraft
app.kubernetes.io/instance: skies
spec:
automountServiceAccountToken: false
dnsConfig:
options:
- name: ndots
value: "1"
imagePullSecrets:
- name: minecraft-pull
nodeSelector:
kubernetes.io/hostname: "********-nas"
terminationGracePeriodSeconds: 180
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
initContainers:
- name: bootstrap
image: registry.quorate.internal/quorate/fsharp-runner@sha256:d7b904f4f0cae9fdba7c7345cdf08c91162245834a8a13658d93396272aeec83
command: [/usr/share/dotnet/dotnet, /opt/fsi/fsi.dll, --exec]
args: [/bootstrap/run.fsx]
env:
- name: SSL_CERT_FILE
value: /artifacts/ca.crt
- name: HOME
value: /tmp
- name: DOTNET_NOLOGO
value: "true"
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: "1"
envFrom:
- secretRef:
name: minecraft
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 2Gi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
volumeMounts:
- name: runtime
mountPath: /data
- name: state
mountPath: /state
- name: backups
mountPath: /backups
- name: files
mountPath: /files
readOnly: true
- name: bootstrap
mountPath: /bootstrap
readOnly: true
- name: rcon
mountPath: /rcon
readOnly: true
- name: artifacts
mountPath: /artifacts
readOnly: true
containers:
- name: minecraft
image: ghcr.io/graalvm/jdk-community:25i4@sha256:3508f7c5ad1e211f353e3a90f5de263574c4b09e40635fdf5a6e5952241f605b
workingDir: /data
command: [/data/mc-server-runner]
args:
- --stop-duration
- 150s
- --named-pipe
- /data/console.in
- --
- java
- "@user_jvm_args.txt"
- "@server_args.txt"
- nogui
ports:
- name: minecraft
containerPort: 25565
protocol: TCP
- name: metrics
containerPort: 19565
protocol: TCP
- name: rcon
containerPort: 25575
protocol: TCP
resources:
requests:
cpu: "2"
memory: 20Gi
limits:
memory: 24Gi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
startupProbe:
exec:
command: [/data/mc-monitor, status, --host, 127.0.0.1, --port, "25565"]
periodSeconds: 10
failureThreshold: 90
timeoutSeconds: 5
readinessProbe:
exec:
command: [/data/mc-monitor, status, --host, 127.0.0.1, --port, "25565"]
periodSeconds: 10
timeoutSeconds: 5
volumeMounts:
- name: runtime
mountPath: /data
- name: state
mountPath: /data/ops.json
subPath: ops.json
- name: state
mountPath: /data/whitelist.json
subPath: whitelist.json
- name: state
mountPath: /data/banned-ips.json
subPath: banned-ips.json
- name: state
mountPath: /data/banned-players.json
subPath: banned-players.json
- name: state
mountPath: /data/usercache.json
subPath: usercache.json
- name: state
mountPath: /data/usernamecache.json
subPath: usernamecache.json
- name: state
mountPath: /data/world
subPath: world
- name: state
mountPath: /data/config/chunky/tasks
subPath: world/data/chunky
- name: state
mountPath: /data/local
subPath: local
- name: state
mountPath: /data/journeymap
subPath: journeymap
- name: backups
mountPath: /data/backups
volumes:
- name: artifacts
projected:
defaultMode: 0440
sources:
- secret:
name: minecraft-artifacts
- secret:
name: minecraft-ca
items:
- key: certificate
path: ca.crt
- name: rcon
secret:
secretName: minecraft-rcon
defaultMode: 0440
- name: bootstrap
configMap:
name: minecraft-boot
- name: state
persistentVolumeClaim:
claimName: minecraft
- name: backups
persistentVolumeClaim:
claimName: minecraft-backups
- name: runtime
emptyDir: {}
- name: files
secret:
secretName: minecraft-files
items:
- key: server.properties
path: server.properties