kind: Deployment
apiVersion: apps/v1
metadata:
  name: minecraft
  namespace: default
  labels:
    app: minecraft
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minecraft
  template:
    metadata:
      labels:
        app: minecraft
    spec:
      containers:
      - name: minecraft
        image: itzg/minecraft-server
        imagePullPolicy: Always
        env:
          - name: EULA
            value: "true"
        ports:
          - containerPort: 25565
            hostPort: 25565
        readinessProbe:
          exec:
            command:
              - mc-monitor
              - status
              - -- host
              - 127.0.0.1
          initialDelaySeconds: 5
          periodSeconds: 5
        resources:
          requests:
            cpu: 50m
            memory: 100Mi
          limits:
            cpu: "1"
            memory: 2Gi
        volumeMounts:
          - mountPath: /data
            name: data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: minecraft