Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【help】How is the data cleaning performed on the pv after deleting the pvc #471

Closed
cscowx opened this issue Dec 20, 2024 · 1 comment
Closed

Comments

@cscowx
Copy link

cscowx commented Dec 20, 2024

Hello everyone,

How is the data cleaning performed on the pv after deleting the pvc

Is this a few scripts to achieve PV data cleaning?

image

image

kubectl exec -it pod/production-local-provisioner-local-static-provisioner-br8fh -n test-k8s -- sh

I went into one of the containers and found these scripts in the /scripts directory.Are these scripts used to automatically clean the data on the PV associated backend storage when a PVC is deleted?

image

As an experiment, I overwrote (i.e., emptied) the /scripts directory of the container and found that deleting the PVC still automatically cleaned up all the data on the filesystem associated with the PV

What is the process of the data cleaning mechanism of the PV, and how does it clean all the data on the file system associated with the PV?

Or to put it this way
How does it use a delete logic to clean up all the data on the file system associated with the PV when it hears that the PVC is deleted?

@andyzhangx
Copy link
Member

When PVC is deleted, the associated PV would be in released state, and pv data would be deleted, code is here:

// DeletePVs will scan through all the existing PVs that are released, and cleanup and
// delete them
func (d *Deleter) DeletePVs() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants