apiVersion: batch/v1beta1 # Needs to be beta for GCP
kind: CronJob
metadata:
  name: scraper-cron
spec:
  # Should run every day at 2 AM Eastern time (6 AM UTC).
  schedule: 0 6 * * *
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: scraper
        spec:
          containers:
              # Keep to latest version
            - image: us-central1-docker.pkg.dev/project-valjean/scraper/scraper:v0.9.6
              name: scraper
              volumeMounts:
                - name: secret
                  mountPath: etc/secret
                  readOnly: true
              env:
                - name: GOOGLE_APPLICATION_CREDENTIALS
                  value: /etc/secret/firebase-io.json
                - name: SPLASH_IP
                  value: splash:8050
                - name: SPIDER_WAIT_TIME
                  value: "5"
                - name: SPLASH_TIMEOUT
                  value: "300"
                - name: LOG_LEVEL
                  value: "INFO"
              resources: {}
          volumes:
          - name: secret
            secret:
              secretName: firebase-io
          restartPolicy: Never
          imagePullSecrets:
                - name: gar-io