Remove a workspace from the command line
Remove a workspace from the command line by deleting its DevWorkspace custom resource.
Before you begin
- You have an active
ocsession on the cluster. See Getting started with the CLI. - You know the workspace name. Run
oc get devworkspacesto list workspace names. - You know the relevant OpenShift Dev Spaces user namespace on the cluster. Visit
https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespaceto get your OpenShift Dev Spaces user namespace asname. On OpenShift, useocto display your current namespace or switch to a namespace. - You are in the OpenShift Dev Spaces user namespace on the cluster.
About this task
Deleting the DevWorkspace custom resource also deletes other workspace resources if they were created by OpenShift Dev Spaces: for example, the referenced DevWorkspaceTemplate and per-workspace PersistentVolumeClaims.
Procedure
Run the following command to remove a workspace:
$ oc delete devworkspace <workspace_name> -n <user_namespace>
Related concepts
Related tasks