apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: green-spider-screenshotter
spec:
  # Saturday at 1:05 UTC
  schedule: "5 1 * * 6"
  jobTemplate:
    spec:
      parallelism: 1
      template:
        spec:
          containers:
          - name: screenshotter
            image: quay.io/netzbegruenung/green-spider-screenshotter:latest
            imagePullPolicy: Always
            volumeMounts:
            - name: secrets
              mountPath: "/secrets"
              readOnly: true
            resources:
              requests:
                cpu: 800m
                memory: 4000M
          # No restarts, as this would mean to start over.
          # TODO: Maintain a queue and change this.
          restartPolicy: Never
          volumes:
          - name: secrets
            secret:
              secretName: green-spider
              items:
              - key: datastore-writer.json
                path: datastore-writer.json
              - key: screenshots-uploader.json
                path: screenshots-uploader.json
