apiVersion: batch/v1
kind: Job
metadata:
  name: jovian-outputdata-job
spec:
  template:
    metadata:
      labels:
        ms: jovian-outputdata-job
    spec:
      restartPolicy: OnFailure
      containers:
      - name: main
        image: alexeyebi/jovian-outputdata-job
        args: ["jovian-outputdata-job"]
        env:
          - name: USER
            valueFrom:
              configMapKeyRef:
                name: jovian-outputdata-config
                key: submission-user
          - name: PASSWORD
            valueFrom:
              configMapKeyRef:
                name: jovian-outputdata-config
                key: submission-password
        volumeMounts:
          - name: aws-config
            mountPath: /root/.aws
          - name: results
            mountPath: /output
          - name: code
            mountPath: /git
      volumes:
        - name: aws-config
          configMap:
            name: aws-config
        - name: results
          persistentVolumeClaim:
            claimName: jovian-outputdata-pvc
        - name: code
          persistentVolumeClaim:
            claimName: jovian-sourcecode-pvc
