apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: anitya
spec:
  concurrencyPolicy: Forbid
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            parent: "cronjobanitya"
        spec:
          containers:
          - name: release-monitoring-web
            image: docker-registry.default.svc:5000/release-monitoring/release-monitoring-web:latest
            command: ["bash", "-c", "/usr/local/bin/anitya_cron.py"]
            env:
            - name: ANITYA_WEB_CONFIG
              value: /etc/anitya/anitya.toml
            volumeMounts:
            - mountPath: /etc/anitya
              name: config-volume
              readOnly: true
            - name: fedora-messaging-config-volume
              mountPath: /etc/fedora-messaging
              readOnly: true
            - name: fedora-messaging-ca-volume
              mountPath: /etc/pki/rabbitmq/ca
              readOnly: true
            - name: fedora-messaging-key-volume
              mountPath: /etc/pki/rabbitmq/key
              readOnly: true
            - name: fedora-messaging-cert-volume
              mountPath: /etc/pki/rabbitmq/cert
              readOnly: true
          restartPolicy: Never
          volumes:
          - name: config-volume
            configMap:
              defaultMode: 420
              name: release-monitoring-configmap
          - name: fedora-messaging-config-volume
            configMap:
              name: fedora-messaging-configmap
          - name: fedora-messaging-ca-volume
            secret:
              secretName: release-monitoring-fedora-messaging-ca
          - name: fedora-messaging-key-volume
            secret:
              secretName: release-monitoring-fedora-messaging-key
          - name: fedora-messaging-cert-volume
            secret:
              secretName: release-monitoring-fedora-messaging-cert

