apiVersion: apps/v1
kind:       Deployment
metadata:
  name: minio
  labels:
    app.kubernetes.io/name: minio
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: minio
  template:
    metadata:
      labels:
        app.kubernetes.io/name: minio
    spec:
      serviceAccountName: minio
      containers:
        - name:            minio
          image:           "minio/minio:RELEASE.2019-08-07T01-59-21Z"
          imagePullPolicy: IfNotPresent
          command: [ "/bin/sh",
                     "-ce",
                     "/usr/bin/docker-entrypoint.sh minio -C /root/.minio/ server /export" ]
          volumeMounts:
            - name:      minio-config-dir
              mountPath: /root/.minio/
            - name:      export
              mountPath: /export
          ports:
            - name:          service
              containerPort: 9000
          env:
            - name: MINIO_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-credentials
                  key:  accesskey
            - name: MINIO_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: minio-credentials
                  key:  secretkey
            - name:  MINIO_BROWSER
              value: "on"
          livenessProbe:
            httpGet:
              path:   /minio/health/live
              port:   service
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds:       30
            timeoutSeconds:      1
            successThreshold:    1
            failureThreshold:    3
          readinessProbe:
            httpGet:
              path: /minio/health/ready
              port: service
            initialDelaySeconds: 5
            periodSeconds:       15
            timeoutSeconds:      1
            successThreshold:    1
            failureThreshold:    3
          resources:
            requests:
              cpu:    250m
              memory: 256Mi

      volumes:
        - name: export
          emptyDir: {}
        - name: minio-config-dir
          emptyDir: {}
