Service Configuration
medium

Pregunta de Service Configuration #019e3a4f

Enunciado de la Pregunta
Service Configuration
#kubernetes
#etcd
#high-availability
#cluster
Medio

What is the minimum of etcd members that are required for a highly available Kubernetes cluster?

A

Two etcd members.

B

Five etcd members.

C

Six etcd members.

D

Three etcd members

Correcto

Explicación Oficial / Explicaciones de la Comunidad

For a highly available Kubernetes cluster, the minimum number of etcd members required is three. This is because etcd uses the Raft consensus algorithm, which requires a majority of nodes to agree on a leader and commit writes. With three members, the cluster can tolerate the failure of one member (since a majority is 2 out of 3). With only two members, a single failure would result in a tie (1 vs 1), preventing the cluster from reaching consensus and causing loss of quorum. Five or six members are not the minimum; they provide higher fault tolerance (e.g., five tolerates two failures) but are not required for basic high availability.

How it Works

etcd is a distributed key-value store that uses the Raft consensus protocol to maintain consistency across the cluster. Raft requires a majority (quorum) of nodes to be available to elect a leader and commit writes. The quorum is calculated as floor(N/2) + 1, where N is the number of members. For N=3, quorum is 2; for N=2, quorum is 2 (but a single failure reduces available nodes to 1, which is less than 2). Therefore, three is the smallest odd number that provides fault tolerance without split-brain scenarios.

Why the Correct Value is Right

  • Three etcd members: This is the minimum required to achieve high availability. With three members, the cluster can survive the loss of one member while still maintaining quorum. This is the standard recommendation for production Kubernetes clusters.

Why the Incorrect Values are Wrong

  • Two etcd members: A two-node etcd cluster cannot tolerate any single node failure because losing one node leaves only one node, which is less than the quorum of 2. This results in a loss of quorum and the cluster becomes unavailable.
  • Five etcd members: While five members provide higher fault tolerance (can tolerate two failures), it is not the minimum requirement. Using five members increases overhead and is unnecessary for basic high availability.
  • Six etcd members: Six members are even more than necessary and introduce additional complexity. The minimum is three, not six. Even numbers are generally avoided in Raft because they do not improve fault tolerance over the next lower odd number (e.g., six tolerates two failures, same as five, but requires more resources).