Adding clusters to team spaces#
This page provides instructions on adding clusters to team spaces and removing them.
Prerequisites#
Make sure that the following requirements are met:
- You have connection to the cluster from your local machine
- You have the Admin or Owner role of the corresponding team space, and/or you have created the cluster on your local machine
Connect a cluster to a team space#
To connect a cluster to a team space:
- In the Top Bar drop-down list, select the team space.
- Navigate to Catalog > Clusters and click the Add Clusters button in the lower-right corner.
- In the following list, choose from the available clusters and wait for the cluster to be added to the team space.
As soon as the cluster is connected to the team space, a green check mark appears in the list next to the cluster.
- In the Top Bar drop-down list, select Local.
- Open a cluster view, click the cluster icon and select Add Cluster to Space. The Cluster Connect menu opens.
- Select a team space in the Lens Space drop-down list.
- In the Region drop-down list, select the region geographically closest to the cluster.
-
Click Add Cluster to Space and wait for the cluster to be added to the team space.
If successful, the Add Cluster to Space button is replaced with Remove Cluster from Space.
Make sure that the cluster is visible in Catalog > Clusters, team space members can start working with the cluster.
Remove a cluster from a team space#
To remove a cluster from a team space:
- In the Top Bar drop-down list, select Local.
- Open a cluster view, click the cluster icon and select Add Cluster to Space. The Cluster Connect menu opens.
-
Click Remove Cluster from Space and wait for the cluster to be removed from the space.
If successful, the Add Cluster to Space button is replaced with Remove Cluster from Space.
- Open the Terminal.
-
Insert the following command:
kubectl delete ns lens-platform kubectl get clusterrolebindings.rbac.authorization.k8s.io -o name | grep bored-agent | xargs kubectl delete kubectl get clusterrolebindings.rbac.authorization.k8s.io -o name | grep lens-platform | xargs kubectl delete kubectl get clusterrole -o name | grep bored-agent | xargs kubectl delete kubectl get clusterrole -o name | grep lens-spaces | xargs kubectl delete kubectl get clusterrole -o name | grep lens-cluster | xargs kubectl delete kubectl get priorityclass -o name | grep lens-cluster | xargs kubectl delete
Execution of this command sequence deletes:
- The namespace where the agent is deployed along with related objects (secrets, service accounts, config maps, and others).
- All ClusterRoles required for the agent to work correctly.
- All ClusterRoleBindings associated with the agent.
- A PriorityClass linked to the agent.