About Me

My photo
I am MCSE in Data Management and Analytics with specialization in MS SQL Server and MCP in Azure. I have over 13+ years of experience in IT industry with expertise in data management, Azure Cloud, Data-Canter Migration, Infrastructure Architecture planning and Virtualization and automation. Contact me if you are looking for any sort of guidance in getting your Infrastructure provisioning automated through Terraform. I sometime write for a place to store my own experiences for future search and read by own blog but can hopefully help others along the way. Thanks.

Understanding PersistentVolume Reclaim Policies in Kubernetes

 In Kubernetes, there are different policies that can be set for a PersistentVolume (PV) to determine what happens to the data on the volume when the corresponding PersistentVolumeClaim (PVC) is deleted. These policies are known as "reclaim policies".



Here are the different reclaim policies in PV:


Retain: If the reclaim policy is set to Retain, the PV will not be deleted when the PVC is deleted. The PV will continue to exist with all its data intact. The administrator can manually reclaim the PV later.

Delete: If the reclaim policy is set to Delete, the PV will be deleted when the PVC is deleted. The data on the PV will be deleted as well. This policy is useful when you want to ensure that the storage space is released when the PVC is deleted.

Recycle: If the reclaim policy is set to Recycle, the PV will be deleted when the PVC is deleted. However, the data on the PV will not be deleted. Instead, the PV will be formatted and made available for a new PVC to use. This policy is useful when you want to reuse the PV for a new PVC with different data.

Note that the Recycle policy is deprecated and is not recommended for use in newer versions of Kubernetes. The Retain and Delete policies are the recommended policies to use.

No comments: