feat(homelab): add existing routes to services, setup both mc worlds

This commit is contained in:
2025-12-27 03:46:18 -08:00
parent 402f1243a2
commit 60c17bf646
10 changed files with 419 additions and 81 deletions

View File

@@ -0,0 +1,30 @@
resources:
requests:
cpu: 1
memory: 500Mi
limits:
memory: 4Gi
cpu: 2000m
minecraftServer:
eula: "TRUE"
type: "PAPER"
version: "1.21.11"
difficulty: hard
motd: "A Minecraft Server."
gameMode: creative
memory: 4G
rcon:
enabled: true
withGeneratedPassword: false
port: 25575
existingSecret: rcon-credentials
secretKey: rcon-password
nodeSelector:
kubernetes.io/hostname: kube
persistence:
dataDir:
enabled: true
Size: 4Gi

View File

@@ -20,6 +20,9 @@ minecraftServer:
existingSecret: rcon-credentials
secretKey: rcon-password
nodeSelector:
kubernetes.io/hostname: kube
persistence:
dataDir:
enabled: true
@@ -69,49 +72,3 @@ extraVolumes:
nfs:
server: 192.168.27.2
path: /backup/minecraft
# initContainers:
# - name: world-restore
# image: busybox:latest
# command:
# - sh
# - -c
# - |
# set -e
#
# echo "=== Minecraft World Restore ==="
#
# BACKUP_FILE="/backups/latest.tgz"
#
# # Check if backup exists
# if [[ ! -f "$BACKUP_FILE" ]]; then
# echo "Skipping restore, server will start with existing/new world"
# exit 0
# fi
#
# echo "✓ Backup found: $BACKUP_FILE"
# echo " Size: $(du -h $BACKUP_FILE | cut -f1)"
#
# # Check if world already exists
# if [ -f /data/world/level.dat ]; then
# echo "⚠ World already exists at /data/world/"
# echo " Replacing with backup..."
# rm -rf /data/world /data/world_nether /data/world_the_end
# fi
#
# # Extract backup
# echo "Extracting backup to /data/..."
# tar -xzf "$BACKUP_FILE" -C /data/
# echo "✓ Extraction complete"
#
# echo ""
# echo "=== Restore Complete ==="
# echo "Restored world size: $(du -sh /data/world 2>/dev/null | cut -f1 || echo 'unknown')"
# ls -lh /data/ | grep -E "^d" || true
# echo ""
# volumeMounts:
# - name: datadir
# mountPath: /data
# - name: backup-volume
# mountPath: /backup
# readOnly: true

View File

@@ -11,3 +11,6 @@ minecraftRouter:
- externalHostname: "mc-rocket.duckdns.org"
host: "minecraft-main"
port: 25565
- externalHostname: "mc-rocket-creative.duckdns.org"
host: "minecraft-creative"
port: 25565