apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: behemoth-md-upload
spec:
  schedule: "@midnight"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: behemoth-md-upload
            image: cloudwallcapital/serenity:2020.12.10-b65
            command: ["/app/venv-py3/bin/python"]
            args: ["serenity/marketdata/fh/behemoth_upload.py"]
            env:
            - name: POSTGRES_SERENITY_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: database-secret-config
                  key: serenity-password
            - name: AZURE_CONNECT_STR
              valueFrom:
                secretKeyRef:
                  name: azure-secret-config
                  key: connect-str
            volumeMounts:
            - mountPath: /behemoth
              name: behemoth
          restartPolicy: OnFailure
          volumes:
            - name: behemoth
              persistentVolumeClaim:
                claimName: behemoth-pv-claim
