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 oc session on the cluster. See Getting started with the CLI.
  • You know the workspace name. Run oc get devworkspaces to list workspace names.
  • You know the relevant OpenShift Dev Spaces user namespace on the cluster. Visit https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespace to get your OpenShift Dev Spaces user namespace as name. On OpenShift, use oc to display your current namespace or switch to a namespace.
  • You are in the OpenShift Dev Spaces user namespace on the cluster.

About this task

Warning

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>