Kubernetes: why would you need more than 2 nodes?

1/25/2020

Given a K8s Cluster(managed cluster for example AKS) with 2 worker nodes, I've read that if one node fails all the pods will be restarted on the second node.

Why would you need more than 2 worker nodes per cluster in this scenario? You always have the possibility to select the number of nodes you want. And the more you select the more expensive it is.

-- Chris
kubernetes

2 Answers

1/27/2020
  • It depends on the solution that you are deploying in the kubernetes cluster and the nature of high-availability that you want to achieve
  • If you want to work on an active-standby mode, where, if one node fails, the pods would be moved to other nodes, two nodes would work fine (as long as the single surviving node has the capacity to run all the pods)
  • Some databases / stateful applications, for instance, need minimum of three replica, so that you can reconcile if there is a mismatch/conflict in data due to network partition (i.e. you can pick the content held by two replicas)
  • For instance, ETCD would need 3 replicas
-- pr-pal
Source: StackOverflow

1/25/2020

If whatever you are building needs only two nodes, then you wouldn't need more than 2. If you are building anything big where the amount of compute, memory needed is much more, then instead of opting for expensive nodes with huge CPU and RAM, you could instead join more and more lower priced nodes to the cluster. This is called horizontal scaling.

-- Shashank V
Source: StackOverflow