---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: valheim-server
  namespace: valheim
spec:
  selector:
    matchLabels:
      app: valheim-server
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: valheim-server
    spec:
      containers:
        - image: ghcr.io/paulkiernan/valheim-server-docker:main-arm64
          name: valheim-server
          env:
            - name: SERVER_NAME
              value: Paulynomial
            - name: WORLD_NAME
              value: Kiernarnia
            - name: SERVER_PASS
              valueFrom:
                secretKeyRef:
                  name: valheim-secrets
                  key: password
            - name: SERVER_PORT
              value: "2456"
          ports:
            - containerPort: 2456
              name: gameport
            - containerPort: 2457
              name: queryport
          resources: {}
          volumeMounts:
            - mountPath: /config
              name: gamefiles
            - mountPath: /opt/valheim
              name: serverfiles
      volumes:
        - name: gamefiles
          persistentVolumeClaim:
            claimName: valheim-server-world-data
        - name: serverfiles
          persistentVolumeClaim:
            claimName: valheim-server-base-data
