I have a dozen or so persistent volumes of type NFS that are managed by my TrueNAS Scale server. Moving the files and folders that the share points to necessitates changing the persistent volume path to point to the new location. Several Pods use the persistent volume via a common persistent volume claim.
Is there a way to change the persistent volume path “live” without having to stop Pods or delete the persistent volume and persistent volume claims that use it?
I’d rather update the yaml file that defines the persistent volume and run the kubectl apply command to update it in real time, without changing anything else.
3
It is not possible to change the path of an existing, bound NFS persistent volume without stopping the pods that use it.
As per this open Github issue :
It is not possible to change the path in existing volumes.
Rename/move the data folder on the NFS server (if the archiveOnDelete policy is not set), then delete pv/pvc, then move the data back to its place after creation of new pv/pvc.
In the case of a database, temporarily replace the command with [“/bin/sleep”, “infinity”] to maintain data consistency.