Need suggestions in deploying my application components using kubernetes


I am going to deploy a solution and willing to have microservices based containerized architecture orchestrated through kubernetes. In my deployment, there will be following components;

applications: mysql DB server + web-app-server
Total VMs: 04 (vm-01, vm-02, vm-03)

For high-availability and load-balancing purposes for each application, I’ve thought to have below structure of running pod replicas on different nodes.

vm-01: DB-replica-1 + web-app-server-replica-1
vm-02: DB-replica-2 + web-app-server-replica-2

Can someone please confirm below;

1-if I should install master kubernetes on vm-03 and create rest of the VMs as worker nodes? Do we need to have separate configurations for master and working nodes and will master be able to manage/control all the applications/replicas running on different VMs as above?
2-in order to run replicas on specific nodes as above, do we need to use nodeSelectors or I can specifically mention the hostnames for pods in my deployment.yaml?
3-any networking issues in above architecture as these applications will be talking to each other extensively in complete solution?
4-any suggestions with respect to replicating the data between replicas (e.g DB replicas running on vm-01 and vm-02).

I’d appreciate if some kubernetes expert helps me out to achieve best possible solution. Thanks



  1. Yes, it is recommended to run the master on a separate VM of the workers. It doesn’t really need to be a big VM, though

  2. That’s mostly an anti-pattern. It’s a difficult shift, but if you specify the CPU each deployment needs, the kubernetes scheduler can schedule to satisfy that. In has heuristics to spread pods in VMs as possible (even on different AZs and that stuff) and is usually good in it’s job. My advice would be to not use nodeSelectors nor anything unless you really need it. And, in that case, consider pod affinity and soft ones (to not deny execution when a node is down, etc.)

  3. No, networking works fine. You may want to check for a network overlay if you need one (like calico)

  4. Probably use an operator and affinity/anti affinity.

Hope this helps!

1 Like