---
apiVersion: batch/v1
kind: Job
metadata:
  name: s3-create-bucket-job
spec:
  template:
    spec:
      restartPolicy: OnFailure
      volumes:
        - name: minio-configuration
          projected:
            sources:
            - configMap:
                name: s3-bucket-config
      containers:
      - name: minio-mc
        image: minio/mc:latest
        imagePullPolicy: IfNotPresent
        command: ["/bin/sh", "/config/initialize"]
        env:
          - name: MINIO_ENDPOINT
            value: s3.default.svc.cluster.local
          - name: MINIO_PORT
            value: "9000"
        volumeMounts:
          - name: minio-configuration
            mountPath: /config
