loft-sh / devpod-provider-kubernetes

DevPod on Kubernetes
Mozilla Public License 2.0
20 stars 16 forks source link

devpod delete kubernetes-pod (infinite wait, pending state) #60

Open solesensei opened 1 week ago

solesensei commented 1 week ago

How can I delete a workspace on a pod that hasn't been created yet, but is in the pending state?

I tried using the command:

devpod delete kubernetes-pod --grace-period 5

But it didn't work. The devpod just displays the message: Waiting, since pod 'devpod-default-ku-26d16' is starting.

It seems the --force option is also not working.

pascalbreuninger commented 1 week ago

Hey @solesensei, thanks for opening this issue. Which state is the pod in? You should be able to delete the workspace after deleting the pod. We should build better controls for this into DevPod itself though

solesensei commented 1 week ago

You can't delete a workspace if the pod is in any state except "ready". If you delete the pod directly, then devpod deletes workspace without problems.

solesensei commented 1 week ago

I guess you don't need to actually wait until ready, before calling kubectl delete.

pascalbreuninger commented 1 week ago

I guess you don't need to actually wait until ready, before calling kubectl delete.

Yeah, it looks like the problem is core DevPod that tries to ensure the workspace runs before calling the providers delete