Kubernetes Cluster Design
Contents
Kubernetes Cluster Install Tools
Considerations
Purpose
Education
- Minikube
- Single node cluster with kubeadm/GCP/AWS
Development & Testing
- Multi-Node Cluster with a Single Master and Multiple Works
- Setup using kubeadm tool or quick provision on GCP or AWS or AKS
Hosting Production Applications
- High Availability Multi-Node Cluster with multiple master nodes.
- kubeadm or kOps on GCP or AWS or other supported platforms.
- Upto 5,000 nodes
- Upto 150,000 PODs in the cluster
- Upto 300,000 total containers
- Upto 100 PODs per node
Nodes | GCP Type | GCP Spec | AWS Type | AWS Spec |
---|---|---|---|---|
1~5 | n1-standard-1 | 1 vCPU 3.75 GB | m3.medium | 1 vCPU 3.75 GB |
6~10 | n1-standard-2 | 2 vCPU 7.5 GB | m3.large | 2 vCPU 7.5 GB |
11~100 | n1-standard-4 | 4 vCPU 15 GB | m3.xlarge | 4 vCPU 15 GB |
101~250 | n1-standard-8 | 8 vCPU 30 GB | m3.2xlarge | 8 vCPU 30 GB |
251~500 | n1-standard-16 | 16 vCPU 60 GB | c4.4xlarge | 16 vCPU 60 GB |
over 500 | n1-standard-32 | 32 vCPU 120 GB | c4.8xlarge | 32 vCPU 120 GB |
On-Premise or Cloud Service
- Use kubeadm for On-Premise
- GKE(Google Cloud Kubernetes Engine) for GCP(Google Cloud Platform)
- kOps for AWS
- AKS(Azure Kubernetes Service) for Azure
Storage
- High Performance - SSD Backed Storage
- Multiple Concurrent Connections - Network Based Storage
- Persistent shared volumes for shared access across multiple PODs
- Label nodes with specific disk types
- Use Node Selectors to assign applications to nodes with specific disk types
Nodes
- Virtual or Physical Machines
- Minimum of 4 Node Cluster(Size based on workload)
- Master vs Worker Nodes
- Linux x86_64 Architecture
- Master nodes can host workloads
- Best practice is to not host workloads on Master nodes
Master Nodes Structure
Structure
The best way is to set 3 ETCDs and 2 Master nodes at least.

Kubernetes Infrastructure
On-Premise vs Cloud Service
On-Premise
On-Premise
is to set their own computer room.Cloud Service
AWS
, GCP
, and Azure
etc.Our Choice
Our Laptop!
This is for studying
Kubernetes
. So we just choose our laptop.Linux vs Windows
Linux
Kubernetes
is running under Linux System.Our Choice
Ubuntu
I’m going to use
Ubuntu
!minikube vs Kubeadm
minikube
minikube
is local Kubernetes
, focusing on making it easy to learn and develop for Kubernetes.Kubeadm
Kubeadm is a tool built to provide
kubeadm init
and kubeadm join
as best-practice “fast paths” for creating Kubernetes
clusters.Our Choice
Kubeadm
I’m going to build
Kubernetes
cluster with multiple nodes. So I’m going to use kubeadm
.Turnkey Solutions vs Hosted Solutions(Managed Solutions)
Turnkey Solutions
Turnkey Solution Responsibility
- You provision VMs
- You configure VMs
- You use scripts to deploy cluster
- You maintain VMs yourself
Turnkey Solution Products
Hosted Solutions(Managed Solutions)
Hosted Solutions Responsibility
- Kubernetes As A Service
- Provider provisions VMs
- Provider installs Kubernetes
- Provider maintains VMs
Hosted Solution Products
- GKE(Google Kubernetes Engine)
- OpenShift Online
- AKS(Azure Kubernetes Service)
- AWS EKS(AWS Elastic Kubernetes Service)
Our Choice
VirtualBox
I’m going to build VMs with
VirtualBox
.Networking Solution
Network Solution Products
Our Choice
weaveworks
weaveworks
is our choice!HA(High Availability) Kubernetes Cluster
HA
We need 2 master nodes at least for HA. Of course, we need more than 2 worker nodes.
Master Nodes

API Server

Controller Manager
|
|

Stacked Topology

- Easier to setup
- Easier to manage
- Fewer servers
- Risk during failures
External ETCD Topology

- Less risky
- Harder to setup
- More servers
Config ETCD to kube-apiserver
--etcd-servers
Check
--etcd-servers
|
|
Our Choice
Our Structure
2 stacked topology master nodes
2 worker nodes
1 ETCD on host
2 worker nodes
1 ETCD on host
ETCD in HA
Design
ETCD is a
distributed
, reliable key-value store
for the most critical data of a distributed system.key-value store
JSON
|
|
YAML
|
|
TOML
|
|
distributed
Consistent

Read
Read
There’s no big problem for consistent reading data.

Write
Write
When users write a data that is same key at same time, there’s a problem!
At this time, it is possible to write to only
At this time, it is possible to write to only
ETCD Leader
.
Leader Election - RAFT
Majority
More than half the votes.
N/2+1
Quorum
Minimum number of the votes.
N/2+1
Quorum
Instances | Quorum | Fault Tolerance |
---|---|---|
1 | 1 | 0 |
2 | 2 | 0 |
3 | 2 | 1 |
4 | 3 | 1 |
5 | 3 | 2 |
6 | 4 | 2 |
7 | 4 | 3 |
Odd or Even?
Managers | Majority | Fault Tolerance |
---|---|---|
1 | 1 | 0 |
2 | 2 | 0 |
3 | 2 | 1 |
4 | 3 | 1 |
5 | 3 | 2 |
6 | 4 | 2 |
7 | 4 | 3 |
Getting Started
|
|
etcd.service
--initial-cluster
--initial-cluster peer-1=https://${PEER1_IP}:2380,peer-2=https://${PEER2_IP}:2380
.
|
|
etcdctl
Set ETCD API Version
|
|
Data Control Commands
Put
|
|
Get
|
|
|
|
Get List
|
|
Our Design
Design
I’m going to set below design.
