kubernetes-sigs / blob-csi-driver

Azure Blob Storage CSI driver
Apache License 2.0
123 stars 83 forks source link

blob containers do not get deleted with static-provisioning #1616

Open CKnoppas opened 3 weeks ago

CKnoppas commented 3 weeks ago

What happened: I am using the driver with static provisioning option following the instructions here https://github.com/kubernetes-sigs/blob-csi-driver/blob/master/deploy/example/e2e_usage.md#static-provisioninguse-an-existing-storage-account

Mounting and writing to the volume is working fine. Each volume created, is generating a blob container in the storage account.

When the PV using the storage class is deleted, the blob container in the storage account does not get deleted.

If i create the azure-cloud-provider secret, deleting the blob containers do** get deleted. https://github.com/kubernetes-sigs/blob-csi-driver/blob/master/docs/read-from-secret.md

What you expected to happen: Deleting of blob containers should work without the azure-cloud-provider secret when using static provisioning as documented here https://github.com/kubernetes-sigs/blob-csi-driver/blob/master/deploy/example/e2e_usage.md#static-provisioninguse-an-existing-storage-account

How to reproduce it: Create a volume in a static storage account with secret ref in the storage class https://github.com/kubernetes-sigs/blob-csi-driver/blob/master/deploy/example/storageclass-blob-secret.yaml

delete the pv + pvc.

Anything else we need to know?: storage class:

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    name: blob-fuse2-std-staging-auth
mountOptions:
- -o allow_other
- --file-cache-timeout-in-seconds=120
- --use-attr-cache=true
- --cancel-list-on-mount-seconds=10
- -o attr_timeout=120
- -o entry_timeout=120
- -o negative_timeout=120
- --log-level=LOG_DEBUG
- --cache-size-mb=1000
parameters:
  csi.storage.k8s.io/node-stage-secret-name: azure-std-staging-storage
  csi.storage.k8s.io/node-stage-secret-namespace: kube-system
  csi.storage.k8s.io/provisioner-secret-name: azure-std-staging-storage
  csi.storage.k8s.io/provisioner-secret-namespace: kube-system
  protocol: fuse2
provisioner: blob.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate

Environment:

andyzhangx commented 5 days ago

@CKnoppas what's the persistentVolumeReclaimPolicy value of your pv? this value defines whether csi driver would delete the container when volume is delete, since your pv is created by yourself, the reclaimPolicy: Delete value in storage class won't take effect