apiVersion: batch/v1
kind: CronJob
metadata:
  name: ingest-eod
spec:
  # UTC
  schedule: "25 3 * * 1-5"
  concurrencyPolicy: Replace
  jobTemplate:
    spec:
      template:
        metadata:
          name: ingest-eod
        spec:
          containers:
          - name: ingest-eod
            image: gregckrause/ingest-eod:latest
            env:
            - name: MONGO_INITDB_ROOT_USERNAME
              valueFrom:
                secretKeyRef:
                  name: mongo
                  key: RootUser
            - name: MONGO_INITDB_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mongo
                  key: RootPassword
            - name: QUANDL_API_KEY
              valueFrom:
                secretKeyRef:
                  name: quandl
                  key: APIKey
          restartPolicy: OnFailure
      parallelism: 4