apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: minio
spec:
  selector:
    matchLabels:
      app: minio
  serviceName: minio-headless-svc
  podManagementPolicy: Parallel
  updateStrategy:
    type: RollingUpdate
  replicas: 0
  template:
    metadata:
      labels:
        app: minio
      annotations:
        prometheus.io/path: /minio/prometheus/metrics
        prometheus.io/port: "9000"
        prometheus.io/scrape: "true"
    spec:
      containers:
      - name: minio
        image: minio/minio
        args:
          - server
        env:
        - name: MINIO_PROMETHEUS_AUTH_TYPE
          value: public
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: minio
              key: accesskey
        - name: MINIO_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: minio
              key: secretkey
        ports:
        - containerPort: 9000
          name: web
        livenessProbe:
          httpGet:
            path: /minio/health/live
            port: 9000
          initialDelaySeconds: 120
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /minio/health/ready
            port: 9000
          initialDelaySeconds: 30
          periodSeconds: 20
        resources:
          requests:
            cpu: 10m
            memory: 25Mi
        volumeMounts:
        - mountPath: /export
          name: data
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
