---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: nextcloud-cron
  namespace: nextcloud
spec:
  suspend: false
  schedule: CRON_TZ=Europe/Zurich */5 * * * *
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 1
  successfulJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            job: nextcloud-cron
        spec:
          restartPolicy: Never
          containers:
            - name: nextcloud-cron
              image: curlimages/curl:7.81.0
              args:
                - "--fail"
                - "-L"
                - "--header"
                - "Host: cloud.${BASE_DOMAIN}"
                - "http://nextcloud.nextcloud.svc.cluster.local/cron.php"
          automountServiceAccountToken: false
