---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubecraft
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kubecraft
  template:
    metadata:
      labels:
        app: kubecraft
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
      containers:
        - name: kubecraft-server
          image: ghcr.io/raynix/kubecraft:v0.2
          ports:
            - containerPort: 25565
              protocol: TCP
          volumeMounts:
            - name: kubecraft-config-volume
              mountPath: /minecraft/server.properties
              subPath: server.properties
            - name: world-volume
              mountPath: /minecraft/world
          resources:
            requests:
              cpu: 500m
              memory: 2Gi
      volumes:
        - name: kubecraft-config-volume
          configMap:
            name: kubecraft
        - name: world-volume
          persistentVolumeClaim:
            claimName: pvc-mc