Solved

K10 Multicluster.


Userlevel 1
  • Comes here often
  • 1 comment

Hi.

Have a problem with Multicluster. I forgot to disconnect a cluster from multicluster before I destroyed it.

I then did the disconnect, but it stays in “Removal pending” on the console. Is there a way to force the removal to pass?

 

Regards,

-Ulf

 

icon

Best answer by Hagag 25 April 2022, 15:10

View original

2 comments

Userlevel 5
Badge +2

Hello @ulfj 

 

you still can remove the clusters by Manually deleted the finalizers which are restricting the cluster for deletion.

 

1- Please issue the below command in order to get the name of your clusters

kubectl get clusters.dist.kio.kasten.io -n kasten-io-mc

2-Try to delete the clusters manually

kubectl delete clusters.dist.kio.kasten.io ${CLUSTER_NAME} -n kasten-io-mc

3- Delete the finalizers by issue the below commands 


kubectl patch --namespace=kasten-io-mc clusters.dist.kio.kasten.io ${CLUSTER_NAME} -p '{"metadata":{"finalizers":null}}' --type=merge
kubectl  patch --namespace=kasten-io-mc clusters.dist.kio.kasten.io ${CLUSTER_NAME} -p '{"metadata":{"finalizers":null}}' --type=merge

 

you can also use the below command to delete them all at once:

for x in $(kubectl get clusters.dist.kio.kasten.io -n kasten-io-mc | awk 'NR>1 {print $1}') ; do kubectl patch --namespace=kasten-io-mc clusters.dist.kio.kasten.io $x -p '{"metadata":{"finalizers":null}}' --type=merge ; done

Good luck

Ahmed Hagag

Userlevel 1

Thanks Ahmed for the solution.

It fixed the problem. :-)

Regards,

-Ulf

 

Comment