rancherlabs / support-tools

Apache License 2.0
140 stars 86 forks source link

`cattle-controllers` ConfigMap Not Found by `rancher2_determine_leader.sh` Script #280

Closed skanakal closed 1 month ago

skanakal commented 1 month ago

Summary: The rancher2_determine_leader.sh script fails to determine the leader of the Rancher instance due to the missing cattle-controllers configmap.

Steps to Reproduce:

Run the following command on a Rancher HA instance:

  1. Run the following command on a Rancher instance:
curl https://raw.githubusercontent.com/rancherlabs/support-tools/master/troubleshooting-scripts/determine-leader/rancher2_determine_leader.sh | sh

Expected Results: The script should identify and print the leader of the Rancher instance.

Actual Results: The script fails with the following error:

Error from server (NotFound): configmaps "cattle-controllers" not found
skanakal commented 1 month ago

This needs to be updated In the newer version, the leader election thru Leases instead of configmaps:

Mon Jul 29 14:33:07 skanakala ☺ ❉ kubectl -n kube-system get lease cattle-controllers -o json | jq -r '.spec.holderIdentity'
rancher-f79fd6bc8-8zwpj
Mon Jul 29 14:33:09 skanakala ☺ ❉