---
apiVersion: batch/v1
kind: Job
metadata:
  name: copyvolumes
spec:
  backoffLimit: 1
  template:
    metadata:
      name: copyvolumes
    spec:
      restartPolicy: "Never"
      volumes:
      - name: sharedvolume
        persistentVolumeClaim:
          claimName: shared-pvc
      - name: orderervolume
        persistentVolumeClaim:
          claimName: orderer-pvc
      - name: cavolume
        persistentVolumeClaim:
          claimName: ca-pvc
      - name: org1volume
        persistentVolumeClaim:
          claimName: org1-pvc
      - name: org2volume
        persistentVolumeClaim:
          claimName: org2-pvc
      - name: dockersocket
        hostPath:
          path: /var/run/docker.sock
      containers:
      - name: copyshared
        image: alpine:3.7
        imagePullPolicy: Always
        command: ["sh", "-c", "echo Wating copy files; sleep 300;"]
        volumeMounts:
        - mountPath: /shared
          name: sharedvolume
      - name: copyorderer
        image: alpine:3.7
        imagePullPolicy: Always
        command: ["sh", "-c", "echo Wating copy files; sleep 300;"]
        volumeMounts:
        - mountPath: /shared
          name: orderervolume
      - name: copyca
        image: alpine:3.7
        imagePullPolicy: Always
        command: ["sh", "-c", "echo Wating copy files; sleep 300;"]
        volumeMounts:
        - mountPath: /shared
          name: cavolume
      - name: copyorg1
        image: alpine:3.7
        imagePullPolicy: Always
        command: ["sh", "-c", "echo Wating copy files; sleep 300;"]
        volumeMounts:
        - mountPath: /shared
          name: org1volume
      - name: copyorg2
        image: alpine:3.7
        imagePullPolicy: Always
        command: ["sh", "-c", "echo Wating copy files; sleep 300;"]
        volumeMounts:
        - mountPath: /shared
          name: org2volume
