Azure / AKS

Azure Kubernetes Service
https://azure.github.io/AKS/
1.97k stars 306 forks source link

[BUG] Persistent volume claims seem to not be cleaned up #3968

Closed catmanjan closed 9 months ago

catmanjan commented 1 year ago

Describe the bug We have a Kubernetes application which creates jobs which create persistent volume claims, through normal operation we have found that we have ended up with a lot of PVC disks in All Resources.

To Reproduce Steps to reproduce the behavior: Not quite sure on these, but....

  1. Run a cronjob which uses a PVC
  2. Delete the job/cronjob and associated persistent volume claims or persistent volumes in different orders
  3. Notice a growing number of PVC disks in All Resources

Expected behavior PVC disks are cleaned up or otherwise

Screenshots image

andyzhangx commented 12 months ago

And we have enabled HonorPVReclaimPolicy for Azure Disk CSI driver on 1.28, so if you are on earlier AKS version:

It is recommended to delete the corresponding PersistentVolumeClaim object instead of the PersistentVolume object when deleting a CSI volume. The external provisioner in the CSI driver will react to the deletion of the PersistentVolumeClaim and based on its reclamation policy, it issues the DeleteVolume call against the CSI volume driver commands to delete the volume. The PersistentVolume object is then deleted.

https://learn.microsoft.com/en-us/azure/aks/csi-storage-drivers

microsoft-github-policy-service[bot] commented 9 months ago

Thanks for reaching out. I'm closing this issue as it was marked with "Answer Provided" and it hasn't had activity for 2 days.

microsoft-github-policy-service[bot] commented 9 months ago

Thanks for reaching out. I'm closing this issue as it was marked with "Answer Provided" and it hasn't had activity for 2 days.