kind: Deployment
apiVersion: apps/v1
metadata:
  name: minio
  labels:
    app: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
        - name: minio
          image: "{{ .Values.image }}"
          args: ['server', '/data', '--console-address', ':9001']
          ports:
            - name: minio
              containerPort: 9000
          volumeMounts:
            - name: minio-volume
              mountPath: /data
          env:
            - name: MINIO_SERVER_URL
              value: "https://{{ .Values.ingress.minioApiDnsName }}"
            - name: MINIO_BROWSER_REDIRECT_URL
              value: "https://{{ .Values.ingress.minioConsoleDnsName }}"
            - name: MINIO_ROOT_USER
              valueFrom:
                secretKeyRef:
                  name: minio-creds
                  key: MINIO_ROOT_USER
            - name: MINIO_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: minio-creds
                  key: MINIO_ROOT_PASSWORD
      volumes:
        - name: minio-volume
          persistentVolumeClaim:
            claimName: minio-pvc
