apiVersion: batch/v1
kind: Job
metadata:
  name: datamon-datamover-job
spec:
  template:
    metadata:
      labels:
        app: datamon-datamover-job
    spec:
      restartPolicy: Never
      containers:
      - name: datamon-bin
        image: gcr.io/onec-co/datamon-datamover:latest
        imagePullPolicy: "Always"
        command: ["datamover"]
        args: [
        "-t", "$TIMESTAMP_FILTER_BEFORE",
        "-f", "$FILELIST_DIR",
        "-d", "$BKUP_PATH"
        ]

        stdin: true
        tty: true
        volumeMounts:
        - mountPath: $PVC_MNT_PATH
          name: shared-vol

        - mountPath: /tmp/gac
          name: google-application-credentials

        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /tmp/gac/google-application-credentials.json

        # resources:
        #   requests:
        #     memory: "15G"

      volumes:

      - name: google-application-credentials
        secret:
          secretName: google-application-credentials

      - name: shared-vol
        persistentVolumeClaim:
          claimName: $PVC_NAME
          # readOnly: false

      # tolerations:
      # - key: "oneconcern.com/flood"
      #   operator: Equal
      #   value: "inundation"
      # nodeSelector:
      #   kubernetes.io/role: "flood-pipeline"

      # tolerations:
      #   - key: "oneconcern.com/dedicated"
      #     operator: Equal
      #     value: "geodude"
      # nodeSelector:
      #     kubernetes.io/role: "geodude"
