This article will show the codes of leader election, first, let’s look at the demonstration below.
First, the Local terminal got the lease, we can confirm that be executing kubectl get lease command. then I terminated the program in the Local terminal, then, we can find the Local(2) terminal got the lease. Finally, I closed the tunnel connection between my computer and my kubernetes cluster, we can find current leader…
client-go leader election example with explanation
Posted on