3 ms·
The default PVC reclaim policy is Delete https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolume
by smartbit 3y ago
The default PVC reclaim policy is Delete https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec https://kubernetes.io/docs/reference/kubernetes-api/config-a.... The PV will be retained after deletion of the PVC by adding
persistentVolumeReclaimPolicy: Retain
Alternatively set the reclaimPolicy on the StorageClass https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy https://kubernetes.io/docs/concepts/storage/storage-classes/... for retaining all PVs of that SC after deletion of a PVC:
reclaimPolicy: Retain
If Lily Cohen would have used either, recovery would have been possible. Of course then Lily would have to explicitly delete the PVs to prevent getting billed for the storage.
- rdg42 3y agoThank you! Had to scroll way too much to read that. On production systems "reclaimPolicy: Retain" on the storageClass feels like a no brainer to (mostly) avoid such disaster.