2020-12-17 05:11:33 +00:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
|
|
|
namespace: default # namespace where the pvc's exist
|
|
|
|
name: volume-migration
|
|
|
|
spec:
|
|
|
|
completions: 1
|
|
|
|
parallelism: 1
|
|
|
|
backoffLimit: 3
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
name: volume-migration
|
|
|
|
labels:
|
|
|
|
name: volume-migration
|
|
|
|
spec:
|
|
|
|
restartPolicy: Never
|
|
|
|
containers:
|
|
|
|
- name: volume-migration
|
|
|
|
image: ubuntu:xenial
|
|
|
|
tty: true
|
|
|
|
command: [ "/bin/sh" ]
|
2023-03-04 15:34:50 +00:00
|
|
|
args: [ "-c", "cp -r -v /mnt/old/. /mnt/new" ]
|
2020-12-17 05:11:33 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: old-vol
|
|
|
|
mountPath: /mnt/old
|
|
|
|
- name: new-vol
|
|
|
|
mountPath: /mnt/new
|
|
|
|
volumes:
|
|
|
|
- name: old-vol
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: data-source-pvc # change to data source pvc
|
|
|
|
- name: new-vol
|
|
|
|
persistentVolumeClaim:
|
2023-03-04 15:34:50 +00:00
|
|
|
claimName: data-target-pvc # change to data target pvc
|