apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: save-routes
spec:
  schedule: "30 0 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: compute-new
            image: gcr.io/poetic-genius-233804/metrics-flask:latest
            imagePullPolicy: Always
            command: ["python",  "save_routes.py",  "--s3"]
            env:
              - name: AWS_ACCESS_KEY_ID
                valueFrom:
                  secretKeyRef:
                    name: aws-credentials
                    key: aws_access_key_id
              - name: AWS_SECRET_ACCESS_KEY
                valueFrom:
                  secretKeyRef:
                    name: aws-credentials
                    key: aws_secret_access_key
          restartPolicy: Never
