apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: mdapi
spec:
  concurrencyPolicy: Forbid
  schedule: "20 * * * *"
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            parent: "cronjobmdapi"
        spec:
          containers:
          - name: mdapi
            image: docker-registry.default.svc:5000/mdapi/mdapi:latest
            command: ["bash", "-c", "/code/mdapi/mdapi-get_repo_md /etc/mdapi/mdapi.cfg; echo failed"]
            volumeMounts:
            - mountPath: /etc/mdapi
              name: config-volume
              readOnly: true
            - mountPath: /var/tmp
              name: data-volume
            - mountPath: /etc/fedora-messaging/
              name: fedora-messaging-config-volume
              readOnly: true
          restartPolicy: Never
          volumes:
          - name: config-volume
            configMap:
                defaultMode: 420
                name: mdapi-configmap
          - name: data-volume
            persistentVolumeClaim:
                claimName: mdapi-storage
          - name: fedora-messaging-config-volume
            configMap:
              name: fedora-messaging-configmap
