Skip to content

How to determine the Rancher Leader pod in Rancher v2.x

Article Number: 000020056

Environment

- SUSE Rancher 2.7.x
- SUSE Rancher 2.8.x
- SUSE Rancher 2.9.x

Situation

During troubleshooting it may be useful to know which of the Rancher server pods, running as part of the rancher Deployment in the cattle-system namespace, is the current leader, and this article details the steps to determine this.

Resolution

To find the Rancher leader pod use either of the following ways :   From Rancher UI :

1. Navigate to the Rancher local cluster 
       2. Click the More Resources on left side menu.
       3. Under the Coordination section -> select Leases
       4. Locate the cattle-controllers Lease, under the kube-system namespace.
       5. Expand the spec section and note the current leader pod name in the holderIdentity field.

From kubectl shell : 

-  Execute the below script from the rancher local cluster kubectl shell : 

curl https://raw.githubusercontent.com/rancherlabs/support-tools/master/troubleshooting-scripts/determine-leader/rancher2_determine_leader.sh | sh