< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Re-host a Member Cluster to Another Host Cluster

This section introduces how to re-host a removed member cluster to another host cluster.

Unbinding a Cluster in Normal State

If a member cluster is removed while in a normal state, no additional operations are required. The member cluster can be directly re-hosted by another host cluster. For detailed steps, please refer to Add a Member Cluster.

Unbinding a Cluster in Abnormal State

If a member cluster is removed while in an abnormal state, run the following command on the member cluster to clear the hosting information. After that, the cluster can be normally re-hosted by another host cluster.

kubectl patch ns kubesphere-system --type merge -p '{"metadata":{"annotations": null}}'

Clean Up Multi-Cluster Configuration Data

After a cluster is unbound, the original resources and multi-cluster configuration data in the cluster will not be automatically cleared. If the unbound cluster has workspace-related configurations, run the following command to manually clean up the configuration data in the removed cluster before re-hosting.

for ns in $(kubectl get ns --field-selector status.phase!=Terminating -o jsonpath='{.items[*].metadata.name}'); do kubectl label ns $ns kubesphere.io/workspace- && kubectl patch ns $ns --type merge -p '{"metadata":{"ownerReferences":[]}}'; done

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.