<p>To my knowledge, <code>etcd</code> uses Raft as a consensus and leader selection algorithm to maintain a leader that is in charge of keeping the ensemble of <code>etcd</code> nodes in sync with data changes within the <code>etcd</code> cluster. Among other things, this allows <code>etcd</code> to recover from node failures in the cluster where <code>etcd</code> runs.</p>
<p>But what about <code>etcd</code> managing <em><strong>other</strong></em> clusters, i.e. clusters other than the one where <code>etcd</code> runs?</p>
<p>For example, say we have an <code>etcd</code> cluster and <strong>separately</strong>, a DB (e.g. MySQL or Redis) cluster comprised of master (read and write) node/s and (read-only) replicas. Can <code>etcd</code> manage node roles for this other cluster?</p>
<p>More specifically:</p>
<ul>
<li><p>Can <code>etcd</code> elect a leader for clusters <strong>other</strong> than the one running <code>etcd</code> and make that information available to other clusters and nodes?</p>
</li>
<li><p>To make this more concrete, using the example above, say a master node in the MySQL DB cluster mentioned in the above example goes down. Note again, that the master and replicas for the MySQL DB are running on a different cluster from the nodes running and hosting <code>etcd</code> data.</p>
<ul>
<li><p>Does <code>etcd</code> provide capabilities to detect this type of node failures on clusters other than <code>etcd</code>'s automatically? If yes, how is this done in practice? (e.g. MySQL DB or any other cluster where nodes can take on different roles).</p>
</li>
<li><p>After detecting such failure, can <code>etcd</code> re-arrange node roles in this separate cluster (i.e. designate new master and replicas), and would it use the Raft leader selection algorithm for this as well?</p>
</li>
<li><p>Once it has done so, can <code>etcd</code> <strong>also</strong> notify client (application) nodes that depend on this DB and configuration accordingly?</p>
</li>
<li><p>Finally, does any of the above require <strong>Kubernetes</strong>? Or can <code>etcd</code> manage external clusters all by its own?</p>
</li>
</ul>
</li>
</ul>
<hr />
<p>In case it helps, <a href="https://stackoverflow.com/q/62392433/1732769">here</a>'s a similar question for Zookeper.</p>

<p>etcd's master election is strictly for electing a leader for etcd itself.</p>
<p>Other clusters, however can use a distributed strongly-consistent key-value store (such as etcd) to implement their own failure detection, leader election and to allow clients of that cluster to respond.</p>
<p>Etcd doesn't manage clusters other than its own.  It's not magic awesome sauce.</p>
<p>If you want to use etcd to manage a mysql cluster, you will need a component which manages the mysql nodes and stores cluster state in etcd.  Clients can watch for changes in that cluster state and adjust.</p>
