This section describes how to unbind a project from its current workspace and reassign it to another workspace.

1. Unbind the Project

In the cluster where the project resides, execute the following command to remove the relationship between the project and its workspace.

kubectl label ns <namespace> kubesphere.io/workspace- && kubectl patch ns <namespace>   -p '{"metadata":{"ownerReferences":[]}}' --type=merge
Note

The above command removes the label associating the project with the workspace and clears the ownerReferences.

2. Remove Project Members

In the cluster where the project resides, execute the following command to remove all members from the project.

kubectl delete rolebindings.iam.kubesphere.io -n <namespace> --all

3. Assign to a New Workspace

  1. Log in to the KubeSphere web console with a user who has Project Management permissions and enter your cluster.

  2. Click Project in the left navigation pane.

  3. In the project list, click more on the right side of the project, then select Assign Workspace from the dropdown list.

  4. In the Assign Workspace dialog box, set the workspace to which the project belongs, select a workspace member as the project administrator, and then click OK.

  5. Navigate to the selected workspace, and you will see the project on the Project Management > Project List page.