apiVersion: batch/v1
kind: Job
metadata:
  name: init-volume
  namespace: medtune
spec:
  template:
    spec:
      containers:
      - name: create-dirs
        image: busybox
        command: [ "mkdir", "-p",
          "/x/weights/mobilenet",
          "/x/artefacts/cod",
          "/x/artefacts/mnist",
          "/x/artefacts/mura",
          "/x/artefacts/chest",          
          "/x/data/cod",
          "/x/data/mnist",
          "/x/data/mura",
          "/x/data/chest" ]
        volumeMounts:
          - mountPath: /x
            name: nfs-volume

      restartPolicy: Never
      volumes:
        - name: nfs-volume
          persistentVolumeClaim:
            claimName: train-pvc
  backoffLimit: 1 # Number of retries