---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: nextcloud-cron
  namespace: nextcloud
  labels:
    app: nextcloud
    component: cronjob
spec:
  schedule: CRON_TZ=Europe/Zurich */5 * * * *
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 1
  successfulJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: nextcloud
            component: cronjob
        spec:
          restartPolicy: Never
          containers:
            - name: nextcloud-cron
              image: busybox:1.35.0
              command:
                - wget
              args:
                - --no-check-certificate
                - --quiet
                - --spider
                - --header
                - "Host: cloud.${BASE_DOMAIN}"
                - http://nextcloud.nextcloud.svc.cluster.local/cron.php
          automountServiceAccountToken: false
