apiVersion: batch/v1
kind: Job
metadata:
  name: dhealth-job-clean-up
spec:
  completions: 1
  ttlSecondsAfterFinished: 0 #to be automatically deleted, 0 seconds after it finishes.
  template:
    metadata:
      name: dhealth-clean-up
    spec:    
      volumes:
        - name: dhealth-volume
          persistentVolumeClaim:
            claimName: dhealth-pvc
      containers:
      - name: command-cleanup-container
        image: ubuntu
        volumeMounts:
          - name: dhealth-volume
            mountPath: /deephealth
        command: ["/bin/bash", "-c", "rm -f $PODOUTPUT/part-*"]
        resources:
          limits:
            memory: "512Mi"
            cpu: "1000m"
      restartPolicy: Never