Can't Remove Management Clusters in UI

I have 3 active clusters registerd in Rancher but there are 5 clusters listed under ‘Cluster Management → Advanced → Mgmt Clusters’. The 2 that I can’t delete are in the following states:

Unavailable: Failed to communicate with the API server during namespace check: Get "https://10.96.0.1:443/api/v1/namespaces/kube-system?timeout=45s": context canceled

Whenever I try to select one of them and the delete it I get the following:

{"type":"error","links":{},"code":"PermissionDenied","message","Method DELETE not supported","status":403}

This is more of an annoyance b/c there are clusters that are showing on my Home screen in non-active states that don’t exist and shouldn’t be there.

Rancher 2.6.2

Did you ever find a resolution for this? I’m having the same problem.

Unfortunately I did not. The only way that I found to remove them was delete the backing Rancher data directory and then re-add all clusters.

I’ve found this that worked since posting :slight_smile:

kubectl get clusters.management.cattle.io  # find the cluster you want to delete 
export CLUSTERID="c-xxxxxxxxx" # 
kubectl patch clusters.management.cattle.io $CLUSTERID -p '{"metadata":{"finalizers":[]}}' --type=merge