How to deploy different modules on different node pools and make "Load Balancer" to specific node pool?

November 9, 2019 132 views
Kubernetes

Hi,

My project has 3 modules: WEB, API and ServerSockets.
I must create a cluster with 3 kubernetes node pools and deploy each module to a node pool.

  1. How to deploy to each node pool?
  2. How to make requests/connections for each module forward to the correct node pool?

Who knows and can help me will be of great help!

And if you have any architectural suggestions, you will also be welcome.

Thanks!

2 comments
  • Just a few clarifying questions:

    Regarding question 1:

    Do your modules need to live on separate nodepools? This can actually restrict a lot of your HA benefits of kubernetes if you have nodes specific to certain nodepools. If its a matter of resource usage you could alternatively combine the resources you would use and allow them all to share nodes with sufficient capacity.

    Regarding question 2:

    Using the LB integrations DO has out of the box you can set your kubernetes service’s ‘externalTrafficPolicy: Local’. This will result in only nodes hosting the service’s pods to show as healthy. Otherwise you could also distribute traffic by exposing a ingress controller service such as nginx.

    https://github.com/kubernetes/ingress-nginx

  • Great, jkwiatkoski!

    I’ll consider your comment :)

    Thanks!

2 Answers

Hi, you can add a nodeSelector to a Deployment resource:

https://kubernetes.io/docs/concepts/configuration/assign-pod-node

One can also use Taints and Tolerations and more information can be found in the docs:

https://kubernetes.io/docs/concepts/configuration/taint-and-toleration

Good luck and all the best.

-Conrad

Thank you, Conrad!

Have another answer? Share your knowledge.