0

I don't have code for this as i am trying to understand it theoretically.

Current state: a PV and PVC get dynamically created by a helm chart. This pv and pvc are using default storage class with delete policy

Future state: I want to attach a new PVC with different storage class (with retain policy) to the existing PV and convert that PV to retain policy.

Is this possible?

shan
  • 125
  • 3
  • 16

1 Answers1

3

Your question isn't clear, are you trying to attach another PVC to an existing PV? If so then that is not possible.

If you want to unclaim the previous PVC and claim with a new PVC, that is also not possible, unless the PV is using the Recycle policy.

In any case, if you remove a PVC while the PV's reclaim policy is delete, the PV will remove itself, if you change it to reclaim, the PV will not be automatically reclaimable.

  • Thanks. I think that answers my question. Marking this correct answer, but what is the best way to transfer the data from the pv to another pv? – shan Apr 09 '21 at 22:15
  • @shan that depends on the type of pv you have. For example an nfs pv, does not require any reconfiguration, because deleting the pv does not delete the files stored in the nfs. Therefore you can simply create the pv again on the same path in the nfa, and the data will still be there. – Daniel Karapishchenko Apr 09 '21 at 23:10