---
apiVersion: apps/v1
kind: StatefulSet

metadata:
  name: minio-server
  labels:
    app.kubernetes.io/name: minio
    app.kubernetes.io/component: server

spec:
  replicas: 1
  serviceName: minio-server
  podManagementPolicy: Parallel

  updateStrategy:
    type: RollingUpdate

  selector:
    matchLabels:
      app.kubernetes.io/component: server
      app.kubernetes.io/name: minio

  template:
    metadata:
      labels:
        app.kubernetes.io/component: server
        app.kubernetes.io/name: minio

    spec:
      enableServiceLinks: false
      restartPolicy: Always
      terminationGracePeriodSeconds: 60

      containers:
        - name: server
          image: minio-server
          imagePullPolicy: IfNotPresent

          args:
            - server
            - /export

          env:
            - name: MINIO_PROMETHEUS_AUTH_TYPE
              value: "public"
            - name: MINIO_BROWSER
              value: "on"

            - name: MINIO_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-server
                  key: accesskey
            - name: MINIO_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-server
                  key: secretkey

          ports:
            - name: http
              containerPort: 9000
              protocol: TCP

          livenessProbe:
            httpGet:
              path: /minio/health/live
              port: http

          readinessProbe:
            httpGet:
              path: /minio/health/ready
              port: http

          volumeMounts:
            - name: data
              mountPath: /export

  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi

...
