apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  labels:
    app: minio
spec:
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
        - name: main
          image: minio/minio
          env:
            - name: MINIO_ROOT_USER
              value: lola
            - name: MINIO_ROOT_PASSWORD
              value: 123secure
          ports:
            - containerPort: 9000
            - containerPort: 9001
          command: [minio, server, /data, --console-address, "0.0.0.0:9001"]
          lifecycle:
            postStart:
              exec:
                command: [mkdir, -p, /data/minio]
          readinessProbe:
            httpGet:
              path: /minio/health/ready
              port: 9000
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /minio/health/live
              port: 9000
            initialDelaySeconds: 5
            periodSeconds: 10
        - name: mc
          image: minio/mc
          command: ["/bin/sh"]
          args: ["-c", "sleep 30; /usr/bin/mc alias set myminio http://minio:9000 lola 123secure; /usr/bin/mc mb myminio/eudico; /usr/bin/mc policy set public myminio/eudico; sleep infinity;"]
