Forming 2 node k8s cluster

Hi Experts

I am experimenting to move an application from monolith in to micro service. Presently application runs on Active-Active cluster environment on two bare metal servers and a storage attached to them.

I want to configure K8s 2 node cluster of both acts as master node and pods running on it (tainting). and if one node goes down then pods running on that specific node need to move to 2nd one and vice versa. Is there any pointers how to achieve this ?



Cluster information:

Kubernetes version:
Cloud being used: bare-metal
Installation method: yum
CNI and version:
CRI and version:

I wouldn’t recomend 2 nodes setup with only masters - there are plenty of reasons why you usually dont spawn nodes on masters (security, performance, invalid setup working).
If you want to achieve this, with only 2 servers, its possible - deploy microservices with 2 replicas on each node (nodeantiaffinity). If one pod doesn’t respond, traffic will be redirected to other.
Even if you have 1 replica, and server fully shuts down, the replica should be spawned somewhere else.

Thanks a lot lot the reply. Is there any pointers or guide I can refer to achieve this ?



Sure: - simple for getting traffic to cluster (there is premade config somewhere there)
But I belive its bet to read docs on k8s side. It requires some time and patiance, but they are really decent.
I mean, to work with k8s platform its worth spending time on learning the basic concepts: pods, services, deployments, and so on. Later it gets smoother, when u understand how infra behaves.

Taint will not allow running anything that doesn’t tolerate the taint.

Instead of taints you want pod affinity/anti affinity, I think. That will prefer to run separately, if possible, but if not (i.e. the node is dead) it will run it together.

In any case, pods are usually spread as an heuristic. It’s not enforced as it is with affinity/anti affinity, but it will be the case most of the time. You may not even need this, depends on how strong you want that guarantee to be :slight_smile:

Hi Experts
I am installing the Redhat OS to bring up K8 cluster. What is the recommended partitioning scheme/size ?