apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  labels:
    app: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio
        ports:
        - containerPort: 9000
        volumeMounts:
        - mountPath: /data
          name: data
        - mountPath: /opt/minio/certs
          name: certs
        args:
        - server
        - --certs-dir
        - /opt/minio/certs
        - /data
        env:
        - name: MINIO_ROOT_USER
          valueFrom:
            secretKeyRef: 
              name: minio
              key: ACCESS_KEY_ID
        - name: MINIO_ROOT_PASSWORD
          valueFrom:
            secretKeyRef: 
              name: minio
              key: ACCESS_SECRET_KEY
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: minio
      - name: certs
        projected:
          sources:
            - secret:
                name: minio-server-tls
                items:
                  - key: tls.crt
                    path: public.crt
                  - key: tls.key
                    path: private.key
