apiVersion: batch/v1
kind: CronJob
metadata:
  name: freshrss-actualize
  namespace: news
  labels:
    app: freshrss-server
spec:
  schedule: "17,47 * * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: freshrss-actualize
              image: freshrss/freshrss:1.18.1-arm
              imagePullPolicy: IfNotPresent
              args:
              - su
              - www-data
              - -s
              - /bin/sh
              - -c
              - |
                  php /var/www/FreshRSS/app/actualize_script.php
              volumeMounts:
                - mountPath: /var/www/FreshRSS/data
                  name: data
          # https://docs.syseleven.de/metakube/de/tutorials/sharing-volumes-between-pods
          affinity:
            podAffinity:
              requiredDuringSchedulingIgnoredDuringExecution:
                - labelSelector:
                    matchLabels:
                      app: freshrss-server
                  topologyKey: "kubernetes.io/hostname"
          restartPolicy: OnFailure
          volumes:
            - name: data
              persistentVolumeClaim:
                claimName: news-data
                readOnly: false
