apiVersion: batch/v1
kind: Job
metadata:
  name: sharadar-backfill
spec:
  template:
    spec:
      containers:
        - name: sharadar-backfill
          image: cloudwallcapital/serenity:2020.12.20-b76
          command: ["/app/venv-py3/bin/python"]
          args: ["serenity/equity/batch/main.py", "--mode", "BACKFILL"]
          env:
          - name: POSTGRES_SHARADAR_PASSWORD
            valueFrom:
              secretKeyRef:
                name: database-secret-config
                key: sharadar-password
          - name: QUANDL_API_KEY
            valueFrom:
              secretKeyRef:
                name: quandl-secret-config
                key: api-key
          - name: LUIGI_DATA_DIR
            value: /luigi
          - name: SMTP_HOSTNAME
            value: serenity-postfix
          volumeMounts:
            - mountPath: /luigi
              name: luigi
      volumes:
        - name: luigi
          persistentVolumeClaim:
            claimName: luigi-pv-claim
      restartPolicy: Never
  backoffLimit: 4
