storageclass reclaimPolicy vs pv reclaimPolicy
Asked Answered
R

1

5

I wanted to know what's the difference of the reclaimPolicy in StorageClass vs. PersistentVolume.

Currently we created multiple PersistentVolume with a StorageClass that has a reclaimPolicy of Delete, however we changed the PersistentVolume's reclaimPolicy manually via kubectl patch pv PV_NAME -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' to have a Retain value.

what will happen now if I try to delete the StorageClass or even the cluster or accidentily remove pvc' s does the value of the StorageClass has any effect on the pv even after creating?

Ruhr answered 27/5, 2021 at 7:31 Comment(0)
S
6

I wanted to know what's the difference of the reclaimPolicy in StorageClass vs. PersistentVolume.

They mean the same thing, the difference is that the one in StorageClass is used for dynamic provisioning of volumes, for manually created persistent volumes they use the reclaimPolicy they were assigned during creation.

what will happen now if I try to delete the StorageClass or even the cluster or accidentily remove pvc' s does the value of the StorageClass has any effect on the pv even after creating?

I don't think anything will happen if you delete StorageClass, no pv or pvc should be deleted. If you delete a PVC then the reclaimPolicy of the PersistentVolume will be used.

Sailfish answered 27/5, 2021 at 8:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.