14

We are planning to build a small docker cluster for our application services. We considered to use 2 master vms for ha, 1 consul(if we choose Swarm) and 5-10 hosts for containers. We have not yet decided what to use - Docker Swarm or Kubernetes.

So the question is what "hardware" requirements (CPU cores, RAM) managers, both Swarm and Kubernetes, can meet to orchestrate this small cluster.

aligin
  • 1,370
  • 1
  • 13
  • 18

2 Answers2

13

Just to clarify a bit on what Robert wrote about Kubernetes. If you want to have up to 5 machines for running your applications even 1-core virtual machine (n1-standard-1 on GCE) should be enough. You can handle 10-node cluster with 2-core virtual machine as Robert said. For official recommendations please take a look at: https://kubernetes.io/docs/setup/best-practices/cluster-large/

However, note that resource usage of our master components is more related to number of pods (containers) you want to run on your cluster. If you want to have say single-digit-number of them, even n1-standard-1 GCE should be enough for 10-node cluster. But it's definitely safer to use n1-standard-2 in case of <=10 node clusters.

As for HA, I agree with Robert that having 3 master VMs is better than 2. Etcd (which is our backing storage) requires more than a half of all registered replicas to be up to work correctly, so in case of 2 instances, all of them needs to be up (which is generally not your goal). If you have 3 instances, one of them can be down.

Let me know if you have more questions about Kubernetes.

Kanaza
  • 60
  • 4
  • Thanks a lot. For the final selection of the Kubernates we prevent the lack of HA that is described in many articles of comparation between Swarm an Kubernates. But as I can see now HA is present. Is that right? – aligin Apr 12 '16 at 07:48
  • HA is present in a way that we have guides how to set it up and were able to run it. But it's not officially supported yet - in a way that we don't have continuous tests for it, etc. – Wojciech Tyczynski Apr 13 '16 at 09:19
  • To update, there are now continuous tests for HA deployments and Google Kubernetes Engine offers highly available masters as part of [regional clusters](https://cloud.google.com/kubernetes-engine/docs/concepts/multi-zone-and-regional-clusters). – Robert Bailey Dec 31 '17 at 18:44
  • The link is no longer valid – Gert van den Berg May 09 '19 at 08:37
5

For Kubernetes, a single 2-core virtual machine (e.g. n1-standard-2 on GCE) can handle 5 nodes and probably 10. If you want to run an HA master configuration, you are likely to want 3 nodes to create a quorum for the etcd instances and you may want to provision slightly larger instances (like an n1-standard-4) to account for the overhead of clustering etcd.

Robert Bailey
  • 17,866
  • 3
  • 50
  • 58