apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  labels:
    app: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      name: minio
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio
        imagePullPolicy: Always
        command: ["minio"]
        args: ["server", "/data"]
        volumeMounts:
        - name: data
          mountPath: /data
        ports:
        - name: service
          containerPort: 9000
        env:
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: minio-user
              key: accesskey
        - name: MINIO_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: minio-user
              key: secretkey
        livenessProbe:
          tcpSocket:
            port: 9000
          timeoutSeconds: 10
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: minio-persistent-storage
      - name: minio-user
        secret:
          secretName: minio-user
