---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: better-minecraft-server-pi
  labels:
    app: better-minecraft
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  replicas: 1
  selector:
    matchLabels:
      app: better-minecraft
  template:
    metadata:
      labels:
        app: better-minecraft
    spec:
      volumes:
        - name: world
          persistentVolumeClaim:
            claimName: nfs-pvc
      containers:
        - name: better-minecraft
          image: benri/better-minecraft-server
          tty: true
          imagePullPolicy: Always
          volumeMounts:
            - name: world
              mountPath: /minecraft-server/world
              subPath: world
            - name: world
              mountPath: /minecraft-server/logs
              subPath: logs
            - name: world
              mountPath: /minecraft-server/config
              subPath: config
            - name: world
              mountPath: /minecraft-server/shrines-saves
              subPath: shrines-saves
          ports:
            - name: game-port
              containerPort: 25565
            - name: voice-chat-port
              containerPort: 24454
          resources:
            requests:
              cpu: 2
              memory: 5Gi
            limits:
              cpu: 3
              memory: 6Gi
          env:
            - name: EULA
              value: "TRUE"
