2

I have a small kubernetes cluster with AWX running.
I would like to make some changes, the PV is a filesystem on one of the nodes.
Is it possible to migrate it to a different PV, like NFS?

Also, I would like to change the CPU and memory limits. But I guess I will have to redeploy it.

Should I try to migrate the PV or delete everything and recreate it?

Thanks

radicaled
  • 2,369
  • 5
  • 30
  • 44

1 Answers1

1

Assuming that you have dynamic provisioning enabled I advice you to use pv-migrate.

This is a cli tool/kubectl plugin to easily migrate the contents of one Kubernetes PersistentVolume to another.

Common use cases:

  1. You have a database with a bound 30 GB PersistentVolumeClaim. It occurred 30 GB was not enough and you filled all the disk space rather quickly. And sadly your StorageClass/provisioner doesn't support volume expansion. Now you need to create a new PVC of 100 GB and somehow copy all the data to the new volume, as-is, with its permissions and so on.
  2. You need to move a PersistentVolumeClaim from one namespace to another.

To migrate contents of PersistentVolumeClaim pvc-a in namespace name-space-a to the PersistentVolumeClaim pvc-b in namespace name-space-b, use the following command:

$ kubectl pv-migrate \
  --source-namespace name-space-a \
  --source pvc-a \
  --dest-namespace name-space-b \
  --dest pvc-b

Take also a look at: change-pv-reclaim-policy, resizing-persistent-volumes-using-kubernetes.

Malgorzata
  • 6,409
  • 1
  • 10
  • 27