<p>I have a HA cluster(say 3 masters with 1 kubes-scheduler pod on each master). There is a container running in each kube-scheduler pod. 
Inside this container, there two problems need to be solved here:</p>

<ol>
<li>How to know which kube-scheduler pod the container is running on?</li>
<li>How to know if the kube-scheduler this container is running on is a leader?</li>
</ol>

<p>I know the "holderIdentity" field of the "...kubernetes.io/leader" annotation of the pod will tell the ID of the leader. Then the only question is how to know which pod the container is running on.
Or there is a way I can simply know if the pod I'm running is a leader.</p>

<p>You can check the logs of <code>kube-scheduler</code>.
You shall see <code>lock is held by &lt;HolderIdentity&gt; and has not yet expired</code> in the logs of non-leader Pods. And also <code>successfully acquired lease</code> or <code>successfully renewed lease</code> in the leader Pod logs.</p>
