apiVersion: batch/v1
kind: Job
metadata:
  name: gitlab-minio-create-buckets-1
  namespace: public-service
  labels:
    app: gitlab
    component: minio
spec:
  activeDeadlineSeconds: 600
  template:
    metadata:
      labels:
        app: gitlab
        component: minio
    spec:
      restartPolicy: OnFailure
      volumes:
        - name: minio-configuration
          projected:
            sources:
            - configMap:
                name: gitlab-minio-config-cm
            - secret:
                name: "gitlab-minio-secret"      
      containers:
      - name: minio-mc
        image: minio/mc:RELEASE.2018-07-13T00-53-22Z
        imagePullPolicy: IfNotPresent
        command: ["/bin/sh", "/config/initialize"]
        env:
          - name: MINIO_ENDPOINT
            value: gitlab-minio-svc
          - name: MINIO_PORT
            value: "9000"
        resources:
          requests:
            cpu: 50m
        volumeMounts:
          - name: minio-configuration
            mountPath: /config
