0

I'm trying to move all my persistent volumes from vSphere to NFS, I managed to do it for many applications that use Deployment kind. All I have to do is:

  • Mount the NFS volume to a different path (/tmp for example)
  • Copy the data from vSphere volume to NFS volume (using cp command in the pod)
  • Swap the volumes names in the Deployment definition and finally get rid of the vSphere volume

Now, I have StatefulSets with volumes to be mounted on each pod. This approach won't work since Kubernetes wont let you modify the field spec.volumeClaimTemplates in StatefulSets definition.

I have 3 replicas and the vSphere volumes were provisioned dynamically, but I have now 3 NFS volumes that I created manually and I want to migrate the existing data to them.

Any idea how to perform this operation?

  • Hello abdelhalimresu, could you add sts spec.volumeClaimTemplates section to the question? How did you set up a Kubernetes cluster (cloud, on-premise, k8s version)? – mozello Mar 28 '22 at 16:18

1 Answers1

0

Have you tried using velero: it's Vmware tool that lets you back up and restore your Kubernetes cluster resources and persistent volumes. You can run Velero with a public cloud platform or on-premises. Velero lets you:

  • Take backups of your cluster and restore in case of loss.
  • Migrate cluster resources to other clusters.
  • Replicate your production cluster to development and testing clusters.