--- apiVersion: apps/v1 kind: StatefulSet metadata: name: mudcraft namespace: mudcraft labels: app: mudcraft spec: replicas: 1 serviceName: mudcraft selector: matchLabels: app: mudcraft template: metadata: labels: app: mudcraft spec: terminationGracePeriodSeconds: 120 containers: - name: mudcraft image: itzg/minecraft-server:java21 imagePullPolicy: Always ports: - name: minecraft containerPort: 25565 protocol: TCP - name: rcon containerPort: 25575 protocol: TCP envFrom: - configMapRef: name: mudcraft-config env: - name: RCON_PASSWORD valueFrom: secretKeyRef: name: mudcraft-secrets key: rcon-password - name: DB_URL value: "jdbc:postgresql://postgres-postgresql.platform.svc.cluster.local:5432/mudcraft" - name: DB_USER value: "mudcraft" - name: DB_PASSWORD valueFrom: secretKeyRef: name: mudcraft-secrets key: db-password volumeMounts: - name: worlds mountPath: /data/worlds - name: plugins mountPath: /data/plugins - name: logs mountPath: /data/logs resources: requests: memory: 7Gi cpu: 2000m limits: memory: 8Gi cpu: 6000m lifecycle: preStop: exec: command: ["/bin/sh", "-c", "rcon-cli stop && sleep 15"] readinessProbe: tcpSocket: port: 25565 initialDelaySeconds: 60 periodSeconds: 15 failureThreshold: 10 livenessProbe: tcpSocket: port: 25565 initialDelaySeconds: 120 periodSeconds: 30 failureThreshold: 5 volumes: - name: worlds persistentVolumeClaim: claimName: mudcraft-worlds - name: plugins persistentVolumeClaim: claimName: mudcraft-plugins - name: logs persistentVolumeClaim: claimName: mudcraft-logs