Search code examples
kubernetespersistent-volumeskubernetes-pvcpersistent-volume-claims

Is it possible to take an existing PV which has Delete policy and different storage class and attach it to a new PVC with different storage class?


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?


Solution

  • 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.