Clusters are in Removal Pending state either after disconnecting or destroying your cluster before using 'disconnect Secondary' in k10multicluster tool.

This article helps in finding and deleting long-running finalizers that are waiting on other resources and can cause deletions to appear stuck in terminating state.


When Kubernetes attempts to delete the cluster object that has or” specified, the Kubernetes API marks the object for deletion by populating .metadata.deletionTimestamp, and returns a 202-status code (HTTP "Accepted"). The cluster object remains in a terminating/Pending state while the control plane, or other components, take the actions defined by the finalizers

Long-running finalizers that are waiting on other resources can cause deletions to appear stuck in terminating state. This is a result of the ServiceAccount (or its corresponding token/bindings) being deleted on the secondary cluster, and 401 or 500 error shown in the k10 dashboard.


K10 multi-cluster dashboard displays ‘Removal Pending’ for primary and secondary clusters, as shown below



Usually, this requires understanding of which API service is not responding and debugging that issue.  

A workaround for the above issue is to remove the clusters by manually deleting the finalizers which are restricting deletion of the cluster. 

Here are the steps to remove an object’s finalizers

  • List down the target cluster. 

# kubectl get -n kasten-io-mc 

  • Delete the target cluster resources by its name.

# kubectl delete ${CLUSTER_NAME} -n kasten-io-mc 

  • Get the finalizer name to be deleted.

# kubectl get -n kasten-io -o yaml 

  • Manually remove an object’s finalizers by patching the metadata.finalizers field to null

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


Below command can be used to delete all clusters at once: 

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