Assign a Project to Another Workspace
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
-
Log in to the KubeSphere web console with a user who has Project Management permissions and enter your cluster.
-
Click Project in the left navigation pane.
-
In the project list, click
on the right side of the project, then select Assign Workspace from the dropdown list.
-
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.
-
Navigate to the selected workspace, and you will see the project on the Project Management > Project List page.