---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: minecraft-proxy-0
  namespace: infra
  labels:
    app: minecraft-proxy-0
spec:
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: minecraft-proxy-0
  template:
    metadata:
      labels:
        app: minecraft-proxy-0
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
      containers:
        - name: proxy-0
          image: "ghcr.io/anthr76/minecraft/velocity:1.0.5"
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 50m
              memory: 512Mi
          readinessProbe:
            tcpSocket:
              port: 25577
            initialDelaySeconds: 30
            periodSeconds: 5
            failureThreshold: 10
            successThreshold: 1
            timeoutSeconds: 1
          livenessProbe:
            tcpSocket:
              port: 25577
            initialDelaySeconds: 30
            periodSeconds: 5
            failureThreshold: 10
            successThreshold: 1
            timeoutSeconds: 1
          ports:
            - name: proxy
              containerPort: 25577
              protocol: TCP
          volumeMounts:
            - mountPath: /app/velocity.toml
              name: velocity-config
              subPath: velocity.toml
            - mountPath: /app/plugins/luckperms/config.yml
              name: luckperms-config
              readOnly: false
              subPath: config.yml
      volumes:
        - configMap:
            defaultMode: 420
            name: minecraft-proxy-velocity
          name: velocity-config
        - name: luckperms-config
          secret:
            secretName: minecraft-luckperms-proxy
