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.
- Rancher v2.x installed in a Kubernetes cluster
Via the Rancher UI
Navigate to the local cluster in which Rancher is installed.
Click the Projects/Namespaces tab, and select the System project.
Under the Resources tab, select Config.
cattle-controllersConfigMap, under the
Expand the Labels & Annotations section and note the current leader pod name in the
Via kubectl with a script
With the kubeconfig for the Rancher server cluster sourced, the leader can be determined using the following script:
curl https://raw.githubusercontent.com/rancherlabs/support-tools/master/troubleshooting-scripts/determine-leader/rancher2_determine_leader.sh | sh