HA Scheduler Strategy in Kubernetes (Evenly distribute pod replicas across machines)

3/16/2021

I wanted to evenly distribute Kubernetes pod replicas in the cluster.

Let's assume I have 2 pods one is having 2 replicas(light weight) and other is having 3 replicas(heavy weight). Also let's assume I have 3 worker nodes in the cluster.

If I deploy the 1st pod with labels of 1st worker then both the 2 replicas will run in 1st worker.

Now if I run 2nd pod having 3 replicas then these should go to each machine (per machine one replica) instead of they going into other 2 machines by leaving the 1st machine. If I have 6 replicas then 2 replicas should go to each machine.

I wanted docker swarm scheduler behaviour like this here https://github.com/docker/swarmkit/issues/308#issue-147931992.

Is it possible to achieve this in Kubernetes without moving to docker swarm?

-- Ram Idavalapati
docker-swarm
kubernetes

0 Answers