Ok, I can explain. First, yes you can attach plain containers which they call standalone containers to an overlay network which is swarm scoped via docker run --network my-network --ip=“10.0.0.X”:
NETWORK ID NAME DRIVER SCOPE
<ID> my-network overlay swarm
In this image Swarm Architecture you can see the swarm load balancers I was referring to. For my understanding of the swarm architecture, they are used for external traffic coming into the swarm services/containers. When a container or service is attached to the overlay network docker internally creates a LB in each node in the cluster, you can see in it when I run docker network inspect my-network
:
“Name”: “my-network”,
"Id": "mo8rcf8ozr05qrnuqh64wamhs",
"Created": "2020-11-16T01:59:20.100290182Z",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.0.1.0/24",
"Gateway": "10.0.1.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"95b8e9c3ab5f9870987c4077ce264b96a810dad573a7fa2de485dd6f4b50f307": {
"Name": "unruffled_haslett",
"EndpointID": "422d83efd66ae36dd10ab0b1eb1a70763ccef6789352b06b8eb3ec8bca48410f",
"MacAddress": "02:42:0a:00:01:0c",
"IPv4Address": "10.0.1.12/24",
"IPv6Address": ""
},
"lb-my-network": {
"Name": "my-network-endpoint",
"EndpointID": "192ffaa13b7d7cfd36c4751f87c3d08dc65e66e97c0a134dfa302f55f77dcef3",
"MacAddress": "02:42:0a:00:01:08",
"IPv4Address": "10.0.1.8/24",
"IPv6Address": ""
}
]
As a new “random” IP address was assigned to this lb-my-network in every node, the probability that it would collide with my static configuration was high because I was using a /24 subnet. My cluster has 16 machines running 100+ containers plus the 16 internal load balancers in a network with only 254 IPs I often ran into problems.