How to run two containers in exclusive nodes?

I would like to launch two containers in exclusive nodes. For example, I have 4 nodes (node ​​-1, node -2, node -3, node -4) and 2 pods (pod-1, pod-2). I want each node to run only one module, and each module to run in two nodes, for example. pod-1 in node -1 and node -2, pod-2 in node -3 and node -4. Is there any way to configure this method?

+4
source share
3 answers

You can force exclusivity by creating container definitions that cannot be planned on one computer. The easiest way to do this is to assign each module the same host port. After you have set up the same host port for both definitions of your container, if you create two replication controllers with two replicas each, then the scheduler will start 2 copies of two containers located on 4 machines.

+8
source

What I definitely wanted to do was compassable through node selection .

+2
source

- , .

+1

All Articles