If the common/per-user PVC is deleted when workspaces are using the common/per-user PVC strategy, the common/per-user PVC will get stuck in a terminating state until all the associated workspace pods are terminated. The pods will eventually get terminated due to workspace timeout, though you could delete the devworkspaces to speed up the process.
From my understanding, what's happening is that PVC deletion will trigger a reconcile -> the workspaces getting reconciled will see that the PVC is being terminated -> the workspace will wait for the PVC to be terminated before attempting to re-create a new common/per-user PVC.
The problem is that the PVC will not terminate until the associated workspace pods are terminated. I haven't yet had a chance to verify why the PVC is waiting in this state (maybe due to finalizers? not sure).
How To Reproduce
Create a workspace that uses the per-user PVC strategy:
The workspace status' will change to Starting Provisioning storage: Shared PVC is in terminating state when doing a kubectl get dw -n $NAMESPACE
The PVC will be stuck in the Terminating state
The workspace will remain in the starting state until the workspace times out or the workspace is deleted
Expected behavior
Ideally, when the common PVC is deleted, all workspaces using the per-user/common PVC storage strategy should fail. This would permit the PVC termination to complete, and allow workspaces to be restarted, and have the per-user/common PVC re-provisioned.
Description
If the common/per-user PVC is deleted when workspaces are using the common/per-user PVC strategy, the common/per-user PVC will get stuck in a terminating state until all the associated workspace pods are terminated. The pods will eventually get terminated due to workspace timeout, though you could delete the devworkspaces to speed up the process.
From my understanding, what's happening is that PVC deletion will trigger a reconcile -> the workspaces getting reconciled will see that the PVC is being terminated -> the workspace will wait for the PVC to be terminated before attempting to re-create a new common/per-user PVC.
The problem is that the PVC will not terminate until the associated workspace pods are terminated. I haven't yet had a chance to verify why the PVC is waiting in this state (maybe due to finalizers? not sure).
How To Reproduce
kubectl delete PVC claim-devworkspace -n $NAMESPACE
Starting Provisioning storage: Shared PVC is in terminating state
when doing akubectl get dw -n $NAMESPACE
Expected behavior
Ideally, when the common PVC is deleted, all workspaces using the per-user/common PVC storage strategy should fail. This would permit the PVC termination to complete, and allow workspaces to be restarted, and have the per-user/common PVC re-provisioned.
Additional context
Discovered this while reviewing https://github.com/devfile/devworkspace-operator/pull/1233#issue-comment-box