apiVersion: apps/v1
kind: Deployment
metadata:
  name: datamon-datamover-test
spec:
  selector:
    matchLabels:
      app: datamon-datamover-test
  replicas: 1
  template:
    metadata:
      labels:
        app: datamon-datamover-test
    spec:
      securityContext:
        fsGroup: 1000
      initContainers:
      - name: set-pvc-vol-perms
        image: ubuntu:latest
        command:
        - chown
        - 1020:2000
        - $PVC_MNT_PATH
        volumeMounts:
        - mountPath: $PVC_MNT_PATH
          name: shared-vol

      containers:
      - name: datamon-bin
        image: gcr.io/onec-co/datamon-datamover:latest
        imagePullPolicy: "Always"

        # command: ["/bin/tini"]
        # args: ["--", "/bin/zsh"]

        command: ["datamover_metrics"]
        args: [
        "-o", "$WRITE_FILES_ONLY",
        "-s", "$TOT_SIZE_TB",
        "-n", "$NUM_FILES"
        ]

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

        env:
        - name: DATAMOVER_BKUP_PATH
          value: $BKUP_PATH

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

      volumes:

      - name: shared-vol
        persistentVolumeClaim:
          claimName: $PVC_NAME

      # 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"


