apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mindustry
  labels:
    app.kubernetes.io/name: mindustry
    app.kubernetes.io/part-of: mindustry
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: mindustry
      app.kubernetes.io/part-of: mindustry
  serviceName: mindustry
  replicas: 1
  revisionHistoryLimit: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: mindustry
        app.kubernetes.io/part-of: mindustry
    spec:
      containers:
        - name: mindustry
          image: docker.pkg.github.com/sjparkinson/mindustry/mindustry:latest
          stdin: true
          tty: true
          securityContext:
            capabilities:
              drop:
                - ALL
          ports:
            - name: tcp
              containerPort: 6567
              protocol: TCP
            - name: udp
              containerPort: 6567
              protocol: UDP
          volumeMounts:
            - name: config
              mountPath: /opt/mindustry/config
          resources:
            requests:
              cpu: 30m
              memory: 128Mi
          livenessProbe: &healthcheck
            tcpSocket:
              port: 6567
          readinessProbe:
            <<: *healthcheck
      imagePullSecrets:
        - name: github
  volumeClaimTemplates:
    - metadata:
        name: config
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: do-block-storage
