Why are there 3 nodes in a default Google Kubernetes Engine cluster?

11/27/2019

A default Google Kubernetes Engine (GKE) cluster

gcloud container clusters create [CLUSTER_NAME] \
--zone [COMPUTE_ZONE]

starts with 3 nodes. What's the idea behind that? Shouldn't 2 nodes in the same zone be sufficient for high availability?

-- stefan.at.wpf
google-kubernetes-engine
kubernetes

1 Answer

11/27/2019

Kubernetes uses etcd for state. Etcd uses Raft for consensus to achieve high availability properties.

When using a consensus protocol like Raft, you need majority in voting. Using 3 nodes you need 2 of 3 nodes to respond for availability. Using 2 nodes, you can not get majority with only 1 of 2 nodes, so you need both 2 nodes to be available.

-- Jonas
Source: StackOverflow