kubernetes-sigs / aws-efs-csi-driver

CSI Driver for Amazon EFS https://aws.amazon.com/efs/
Apache License 2.0
711 stars 545 forks source link

Delete Released PV will not clear it's access point #1375

Closed LuoYuWuSheng closed 3 months ago

LuoYuWuSheng commented 3 months ago

/kind bug

What happened? when you delete Released PV, efs csi will not clear it's access point. This will case AP num increase quickly, and reach EFS AP limits which is 1000.

What you expected to happen? when delete Released PV, efs csi should clear it's access point.

How to reproduce it (as minimally and precisely as possible)? create an pv use below SC,and delete it. Then you will still find ap in efs.

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: efs-sc-dynamic
parameters:
  basePath: /dynamic_provisioning
  directoryPerms: "777"
  fileSystemId: xxxxxxxxxxxxxxxxx
  gid: "1000"
  provisioningMode: efs-ap
  uid: "1000"
provisioner: efs.csi.aws.com
reclaimPolicy: Retain
volumeBindingMode: Immediate

Anything else we need to know?:

Environment

Please also attach debug logs to help us better diagnose

mskanth972 commented 3 months ago

Hi @LuoYuWuSheng, can you please set the parameter reclaimPolicy: Delete in your StorageClass configuration and try it. This will ensure that the access point is automatically deleted when the PersistentVolume (PV) is deleted.

mskanth972 commented 3 months ago

Assuming issue was resolved as there is no further response. Please feel free to open if you are facing the issue still.

LuoYuWuSheng commented 1 month ago

We need reclaimPolicy: Retain to maintains data according to production plan. But when we want to drop PV, AP leaked