From 72b006a7e4d8cc333506aa308804e671307f7c2e Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Sat, 15 Nov 2025 13:22:23 +0500 Subject: [PATCH] feat: Minecraft | add ATM10 and enable backups --- minecraft/pvc.yaml | 18 ++++++-- minecraft/service.yaml | 15 +++++++ minecraft/statefulset.yaml | 89 +++++++++++++++++++++++++++++++++++--- 3 files changed, 113 insertions(+), 9 deletions(-) diff --git a/minecraft/pvc.yaml b/minecraft/pvc.yaml index 1a64c0d..2edd9b3 100644 --- a/minecraft/pvc.yaml +++ b/minecraft/pvc.yaml @@ -5,7 +5,6 @@ metadata: name: monifactory-data namespace: minecraft spec: - storageClassName: longhorn-crypto accessModes: - ReadWriteMany resources: @@ -18,7 +17,6 @@ metadata: name: gtnh-data namespace: minecraft spec: - storageClassName: longhorn-crypto accessModes: - ReadWriteMany resources: @@ -31,7 +29,21 @@ metadata: name: tfg-data namespace: minecraft spec: - storageClassName: longhorn-crypto + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: atm10-data + namespace: minecraft + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job.longhorn.io/backup: "enabled" +spec: accessModes: - ReadWriteMany resources: diff --git a/minecraft/service.yaml b/minecraft/service.yaml index 96c31cc..87000cc 100644 --- a/minecraft/service.yaml +++ b/minecraft/service.yaml @@ -43,3 +43,18 @@ spec: port: 25565 selector: app: tfg-server +--- +apiVersion: v1 +kind: Service +metadata: + name: atm10-server + namespace: minecraft + labels: + app: atm10-server +spec: + type: ClusterIP + ports: + - name: atm10 + port: 25565 + selector: + app: atm10-server diff --git a/minecraft/statefulset.yaml b/minecraft/statefulset.yaml index 118d025..d6e11b7 100644 --- a/minecraft/statefulset.yaml +++ b/minecraft/statefulset.yaml @@ -5,6 +5,7 @@ metadata: name: monifactory-server namespace: minecraft spec: + serviceName: monifactory-server selector: matchLabels: app: monifactory-server @@ -13,6 +14,8 @@ spec: labels: app: monifactory-server spec: + nodeSelector: + nodepool: worker containers: - name: monifactory-server image: itzg/minecraft-server:java17 @@ -37,7 +40,7 @@ spec: - name: INIT_MEMORY value: 4G - name: MAX_MEMORY - value: 8G + value: 12G - name: ALLOW_FLIGHT value: "TRUE" - name: ENABLE_ROLLING_LOGS @@ -53,7 +56,7 @@ spec: memory: "4Gi" limits: cpu: 8 - memory: "8Gi" + memory: "12Gi" volumeMounts: - name: monifactory-data mountPath: /data @@ -68,6 +71,7 @@ metadata: name: gtnh-server namespace: minecraft spec: + serviceName: gtnh-server selector: matchLabels: app: gtnh-server @@ -76,6 +80,8 @@ spec: labels: app: gtnh-server spec: + nodeSelector: + nodepool: worker containers: - name: gtnh-server image: itzg/minecraft-server:java25 @@ -97,7 +103,7 @@ spec: - name: SKIP_GENERIC_PACK_UPDATE_CHECK value: "true" - name: MEMORY - value: 6G + value: 12G - name: JVM_OPTS value: "-Dfml.readTimeout=180 -Dfml.queryResult=confirm @java9args.txt" - name: CUSTOM_JAR_EXEC @@ -112,7 +118,7 @@ spec: resources: limits: cpu: 8 - memory: "8Gi" + memory: "12Gi" volumeMounts: - name: gtnh-data mountPath: /data @@ -127,6 +133,7 @@ metadata: name: tfg-server namespace: minecraft spec: + serviceName: tfg-server selector: matchLabels: app: tfg-server @@ -135,6 +142,8 @@ spec: labels: app: tfg-server spec: + nodeSelector: + nodepool: worker containers: - name: tfg-server image: itzg/minecraft-server:java17 @@ -159,7 +168,7 @@ spec: - name: INIT_MEMORY value: 2G - name: MAX_MEMORY - value: 8G + value: 12G - name: ALLOW_FLIGHT value: "TRUE" - name: ENABLE_ROLLING_LOGS @@ -175,7 +184,7 @@ spec: memory: "2Gi" limits: cpu: 6 - memory: "9Gi" + memory: "12Gi" volumeMounts: - name: tfg-data mountPath: /data @@ -183,3 +192,71 @@ spec: - name: tfg-data persistentVolumeClaim: claimName: tfg-data +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: atm10-server + namespace: minecraft +spec: + serviceName: atm10-server + selector: + matchLabels: + app: atm10-server + template: + metadata: + labels: + app: atm10-server + spec: + nodeSelector: + nodepool: worker + containers: + - name: atm10-server + image: itzg/minecraft-server:java21 + env: + - name: EULA + value: "TRUE" + - name: MODE + value: "survival" + - name: MODPACK_PLATFORM + value: "AUTO_CURSEFORGE" + - name: CF_API_KEY + valueFrom: + secretKeyRef: + name: curseforge + key: credential + - name: CF_PAGE_URL + value: "https://www.curseforge.com/minecraft/modpacks/all-the-mods-10/files/7121777" + - name: VERSION + value: "1.21.1" + - name: INIT_MEMORY + value: 2G + - name: MAX_MEMORY + value: 15G + - name: ALLOW_FLIGHT + value: "TRUE" + - name: ENABLE_ROLLING_LOGS + value: "TRUE" + - name: USE_MEOWICE_FLAGS + value: "TRUE" + - name: CF_OVERRIDES_EXCLUSIONS + value: | + # Not applicable for server side + shaderpacks/** + ports: + - name: minecraft + containerPort: 25565 + resources: + requests: + cpu: 2 + memory: "2Gi" + limits: + cpu: 6 + memory: "16Gi" + volumeMounts: + - name: atm10-data + mountPath: /data + volumes: + - name: atm10-data + persistentVolumeClaim: + claimName: atm10-data