We want to use docker swarm with Elasticsearch in containers. That is multiple instances of Elasticsearch in different Docker hosts that operate in a swarm.
However, we would like to use a large subnet and then restrict access between containers per container. Is this possible?
For example:
Host 1: Host 2:
192.168.1.10 192.168.1.11
- Elasticsearch-node1<----------------------->Elasticsearch-node2
192.168.1.12 192.168.1.13
- Elasticsearch-node3<----------------------->Elasticsearch-node4
In the above example all containers utilize a 192.168.1.0/24 network but we want to limit access so that node1 can only communicate with node2 and not node3 or node4. How would we achieve this?