apiVersion: batch/v1
kind: CronJob
metadata:
  name: nextcloud-webcron
  namespace: nextcloud
spec:
  schedule: "*/5 * * * *"   # alle 5 Minuten
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 3
  jobTemplate:
    spec:
      activeDeadlineSeconds: 300
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: webcron
              image: curlimages/curl:8.5.0
              command: ["/bin/sh", "-c"]
              args:
                - 'until curl -fsS http://nextcloud.nextcloud.svc.cluster.local/status.php; do echo "waiting for nextcloud..."; sleep 5; done; curl -s -o /dev/null -w "%{http_code}\n" http://nextcloud.nextcloud.svc.cluster.local/cron.php'