- create a new PersistentVolumeClaim
- create migration Pod
---
apiVersion: v1
kind: Pod
metadata:
name: migrate
spec:
containers:
- name: migrate
image: centos:7
volumeMounts:
- name: from
mountPath: /from
- name: to
mountPath: /to
command:
- sleep
- 2h
volumes:
- name: from
persistentVolumeClaim:
claimName: <PERSISTENT_VOLUME_MIGRATE_FROM>
- name: to
persistentVolumeClaim:
claimName: <PERSISTENT_VOLUME_MIGRATE_TO>
kubectl exec migrate -- cp -r /from /to
- delete migration Pod
- configure your Deployment to use new PersistentVolumeClaim
- check new Deployment is running successfully
- delete old PersistentVolumeClaim