cloud-cluster/minecraft/tfg-deployment.yaml
2025-03-24 03:57:57 +04:00

94 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: tfg
namespace: minecraft
labels:
app.kubernetes.io/name: tfg
spec:
serviceName: tfg
selector:
matchLabels:
app.kubernetes.io/name: tfg
replicas: 1
template:
metadata:
namespace: minecraft
labels:
app.kubernetes.io/name: tfg
containertype: minecraft-server
spec:
containers:
- name: tfg
image: itzg/minecraft-server:java21-graalvm
env:
# Let jvm figure out memory based on limits
- name: MEMORY
value: ""
- name: JVM_XX_OPTS
value: "-XX:MaxRAMPercentage=75"
- name: ALLOW_FLIGHT
value: "true"
- name: CF_API_KEY
value: $2a$10$GE.ruAAiogu1Zq2/oyPhzuGgFkXxID2ofiIXtnehJlS98/sK6J.Ya
- name: CF_FILE_ID
value: "6123835"
- name: CF_OVERRIDES_EXCLUSIONS
value: |
shaderpacks/**
- name: CF_PARALLEL_DOWNLOADS
value: "1"
- name: CF_SLUG
value: terrafirmagreg-modern
- name: EULA
value: "TRUE"
- name: MAX_TICK_TIME
value: "-1"
- name: MOD_PLATFORM
value: AUTO_CURSEFORGE
- name: ONLINE_MODE
value: "false"
- name: OVERRIDE_SERVER_PROPERTIES
value: "true"
- name: SPAWN_PROTECTION
value: "0"
- name: OPS
value: |
RoyalCat33
RoyalCat20
Zoryka
ports:
- containerPort: 25565
protocol: TCP
resources:
requests:
cpu: "1"
memory: "2Gi"
limits:
cpu: "4"
memory: "10Gi"
readinessProbe:
exec:
command:
["/usr/local/bin/mc-monitor", "status", "--host", "localhost"]
# Give it i + p * f seconds to be ready, so 120 seconds
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 20
# Monitor ongoing liveness
livenessProbe:
exec:
command:
["/usr/local/bin/mc-monitor", "status", "--host", "localhost"]
initialDelaySeconds: 120
periodSeconds: 60
volumeMounts:
- mountPath: /data
name: tfg-data
volumes:
- name: tfg-data
persistentVolumeClaim:
claimName: tfg-data