apiVersion: batch/v1
kind: Job
metadata:
  name: prepare-mnist
  namespace: medtune
spec:
  template:
    spec:
      containers:
      - name: mnist2tfrecord
        image: medtune/k8s-tf:pre-train
        args: [ "--directory",  "/nfs/data/mnist" ]
        
        volumeMounts:
          - mountPath: /nfs
            name: nfs-volume

      volumes:
        - name: nfs-volume
          persistentVolumeClaim:
            claimName: train-pvc

      restartPolicy: Never
  backoffLimit: 1 # Number of retries