kubernetes - can we create 2 node master-only cluster with High availability

7/25/2019

I am new to the Kubernetes and cluster.

I would like to bring up an High Availability Master Only Kubernetes Cluster(Need Not to!).

I have the 2 Instances/Servers running Kubernetes daemon, and running different kind of pods on both the Nodes.

Now I would like to somehow create the cluster and if the one of the host(2) down, then all the pods from that host(2) should move to the another host(1).

once the host(2) comes up. the pods should float back.

Please let me know if there is any way i can achieve this?

-- user1830237
high-availability
kubernetes
kubernetes-cluster

1 Answer

7/25/2019

It is possible that master node serves also as a worker node however it is not advisable on production environments, mainly for performance reasons.

By default, kubeadm configures master node so that no workload can be run on it and only regular nodes, added later would be able to handle it. But you can easily override this default behaviour.

In order to enable workload to be scheduled also on master node you need to remove from it the following taint, which is added by default:

kubectl taint nodes --all node-role.kubernetes.io/master-

To install and configure multi-master kubernetes cluster you can follow this tutorial. It describes scenario with 3 master nodes but you can easily customize it to your needs.

-- mario
Source: StackOverflow