<p>In HA kubernetes clusters, we configure multiple control planes(master nodes), but how does multiple control planes sync their data? When we create a pod using kubectl command, the request went through the cloud load balancer to one of the control plane. I want to understand how other control planes sync their data with the one that got the new request?</p>

Vinay Sorout
<p>First of all, please note that <strong>API Server</strong> is the only component that directly talks with the <strong>etcd</strong>.<br />
Every change made on the Kubernetes cluster ( e.g. <code>kubectl create</code>) will create appropriate entry in <strong>etcd</strong> database and everything you will get from a <code>kubectl get</code> command is stored in <strong>etcd</strong>.</p>
<p>In this <a href="https://medium.com/jorgeacetozi/kubernetes-master-components-etcd-api-server-controller-manager-and-scheduler-3a0179fc8186" rel="nofollow noreferrer">article</a> you can find detailed explanation of communication between <strong>API Server</strong> and <strong>etcd</strong>.</p>
<p>Etcd uses <strong>RAFT</strong> protocol for leader election and that leader handles all client requests which need cluster consensus ( requests that do not require consensus can be processed by any cluster member ):</p>
<blockquote>
<p>etcd is built on the Raft consensus algorithm to ensure data store consistency across all nodes in a cluster—table stakes for a fault-tolerant distributed system.</p>
</blockquote>
<blockquote>
<p>Raft achieves this consistency via an elected leader node that manages replication for the other nodes in the cluster, called followers. The leader accepts requests from the clients, which it then forwards to follower nodes. Once the leader has ascertained that a majority of follower nodes have stored each new request as a log entry, it applies the entry to its local state machine and returns the result of that execution—a ‘write’—to the client. If followers crash or network packets are lost, the leader retries until all followers have stored all log entries consistently.</p>
</blockquote>
<p>More information about <strong>etcd</strong> and <strong>raft consensus algorithm</strong> can be found in this <a href="https://www.ibm.com/cloud/learn/etcd" rel="nofollow noreferrer">documentation</a>.</p>
