kubernetes-csi/csi-driver-nfs

Delete the PV but retain the NFS subDir when dynamic provisioned

dcarrion87 opened this issue · 6 comments

Is your feature request related to a problem?/Why is this needed

  • When deleting a PVC with Retain policy the PV goes to Released and lingers forever.
  • We want the ability to just remove the PVs but retain the underlying subDir that was created.

Describe the solution you'd like in detail

  • When using dynamic provisioning, provide an option to Delete the PV without actually deleting the underlying directory.

Describe alternatives you've considered

you could set reclaimPolicy: Retain in storage class to retain subDir when PV is deleted.

That's what I currently have but it leaves the PV around and I need to kubectl delete pv <random-id-nfs-csi-created> the Released PV afterwards.

If I set to reclaimPolicy: Delete then it does delete but it also deletes the subDir

@andyzhangx I should have mentioned there's a similar feature:

onDelete: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

/remove-lifecycle rotten