apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: minio
  labels:
    app: minio
spec:
  selector:
    matchLabels:
      app: minio
  serviceName: "minio-service"
  replicas: 1
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio:latest
        args:
        - server
        - /data
        volumeMounts:
        - name: pvc
          mountPath: '/data'
        env:
        - name: MINIO_ROOT_USER
          valueFrom:
            secretKeyRef:
              name: minio-conf
              key: root_user
        - name: MINIO_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: minio-conf
              key: root_password
        ports:
        - containerPort: 9000
  volumeClaimTemplates:
  - metadata:
      name: pvc
    spec:
      storageClassName: minio
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 100Mi
