Reputation: 27
The problem is that I need to modify the StorageClassName but it's not possible because there was a blank StorageClassName assigned.
This PVC is bound to a PV, so, if I delete the PVC to create a new one with the StorageClassName, the data that is in my AWS will be deleted?
Upvotes: 1
Views: 1504
Reputation: 3260
You can recreate an existing PVC reusing the same PV with no data losses by using reclaim policy.
In case of Delete, the PV is deleted automatically when the PVC is removed, and the data on the PVC will also be lost. In that case, it is more appropriate to use the “Retain” policy. With the “Retain” policy, if a user deletes a PersistentVolumeClaim, the corresponding PersistentVolume is not deleted. Instead, it is moved to the Released phase, where all of its data can be manually recovered.
Reclaim Policy: Used to tell the cluster what to do with the volume after releasing its claim. Current reclaim policies are:
NOTE: Extremely recommended to use Retain policy for PVCs that store critical data.
Here in this blog you have detailed steps to recreate a PVC in another name space similarly you can change the storage class.
Upvotes: 4