---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: mc-user-create-cronjob
  namespace: minio-tenant-default
spec:
  jobTemplate:
    spec:
      activeDeadlineSeconds: 300
      backoffLimit: 1
      template:
        spec:
          containers:
            - command:
                - bash
                - /mnt/scripts/mc-user-create.sh
              image: minio/mc@sha256:a7fe349ef4bd8521fb8497f55c6042871b2ae640607cf99d9bede5e9bdf11727 # Original tag: latest
              name: mc
              resources:
                limits:
                  cpu: 500m
                  memory: 128Mi
                requests:
                  cpu: 100m
                  memory: 32Mi
              volumeMounts:
                - mountPath: /tmp/minio-config
                  name: configuration
                - mountPath: /tmp/minio-user
                  name: user
                - mountPath: /mnt/scripts/
                  name: script
          restartPolicy: Never
          volumes:
            - configMap:
                name: mc-user-create-cm
              name: script
            - name: configuration
              projected:
                defaultMode: 420
                sources:
                  - secret:
                      name: default-minio-tenant-env-configuration
            - name: user
              projected:
                defaultMode: 448
                sources:
                  - secret:
                      name: default-user
  schedule: '*/5 * * * *'