Hi :wave: Our app is migrating to a new namespac...
# general
b
Hi 👋 Our app is migrating to a new namespace in Rancher-managed Kubernetes. Currently, the app uses a PVC that is bound to the old namespace. What is the recommended way to migrate or reuse the existing PVC in the new namespace?
m
What storage csi are you using? Local provisioner?
b
Local provisioner
m
You are limited by the local provisioner csi; and there is no migration since the pvc is namespace scoped. The long way is to scale workload to 0. Attach a toolbox or default image to the pvc, kubectl cp the data to the server host, then spin up the new deployment/pvc, set it to 0. Deploy the toolbox pod and attach the new pvc. Then kubectl cp from server host to the new pvc.
A quick internet search found this tool https://github.com/utkuozdemir/pv-migrate, but i've never used it. Might be worth a try in a lab env before attempting in a dev/prod.
b
IMG_5212.jpg
This is how pvc provisioned