apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: minio
  namespace: minio
spec:
  selector:
    matchLabels:
      app: minio # has to match .spec.template.metadata.labels
  serviceName: "minio"
  replicas: 1 # by default is 1
  template:
    metadata:
      labels:
        app: minio # has to match .spec.selector.matchLabels
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: minio
        image: minio/minio:latest
        args:
        - server
        - /data
        env:
        - name: MINIO_ACCESS_KEY
          value: "minio_access"
        - name: MINIO_SECRET_KEY
          value: "minio_secret"
        ports:
        - containerPort: 9000
          name: tcp
          protocol: TCP
        volumeMounts:
        - name: minio-pvc
          mountPath: /data
  volumeClaimTemplates:
  - metadata:
      name: minio-pvc
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "local-minio-storage"
      resources:
        requests:
          storage: 1Gi
