digitalocean/csi-digitalocean

Detach k8s in-use block storage in DO Dashboard, container still running

ty2 opened this issue · 2 comments

ty2 commented

What did you do? (required. The issue will be closed when not provided.)

Detach a block storage that is attached to a k8s container in DO Dashboard

What did you expect to happen?

K8s will automatically reattached the block storage and recreate the container.

What is happened?

Container still running after detached the block storage in DO dashboard.

Configuration (MUST fill this out):

k8s version: 1.16.6-do.2
csi version: 1.2.0

I don't know whether this is related to csi, I just want to avoid data loss if the block storage is detached improperly or by indecent, could you give me some advise?

Hi @ty2 👋

we suggest to operate on managed volumes through Kubernetes only. The CSI framework is not really designed to cope with changes that have been done out-of-band. Changing that would be quite an undertaking since CSI drivers respond to external triggers from the sidecars and Kubernetes only but do not (and IMO also should not) take proactive actions.

There is also a potential risk for data loss and corruption if a volume is being detached while it is in use. Managing volumes through Kubernetes means that volumes won't be detached until all consumers have stopped running.

I'd be eager to learn your use case for detaching a managed block storage volume through the DO cloud control panel. Would you mind sharing?

Thanks.

Closing the ticket due to lack of activity. Happy to reopen if the OP or other folks can clarify on the use case.