I’ve been following the docker swarm tutorial and I’m at the portion where I’m creating the following service and trying to access it on port 8080. This is on a fresh Raspbian 64-bit installation (light in this second test, but full in the original on another Pi host in the same network)
docker service create --name my_web
--replicas 3
--publish published=8080,target=80
nginx
When I create the service, everything is successful but I can’t access the web application using any of the swarm devices LAN ips. However, when I access it in WireGuard it loads just fine; no issues at all.
For context, here’s my network setup. I’m on an OPNSense router which plugs into a USW-24-Pro, which has 3 Raspberry Pi 5’s connected via ethernet. The devices I’m configuring this from are connected via an Wifi6 AP, which also plugs into the USW-24-Pro. When I mention WireGuard, I’m connected remotely to the OPNSense router. Here’s the subnet configuration:
Subnet: 10.0.0.0/24
Gateway: 10.0.0.1
WireGuard Subnet: 10.0.2.1/24
Peer: 10.0.2.2/32
Here’s the steps I’ve taken so far:
- Install Docker via the get-docker.sh script
- Once installed, I run docker swarm init to create a swarm.
docker swarm init --advertise-addr=10.0.0.28
- I add 2 additional nodes using the
docker swarm join --token <token> 10.0.0.28:2377
- Going to back to the Leader node, I create the service mentioned above:
docker service create --name my_web
--replicas 3
--publish published=8080,target=80
nginx
-
On a worker node, I run nmap to ensure that the port is open which returns:
-
I inspected the ingress network it created which shows:
[
{
"Name": "ingress",
"Id": "8uf497xyhbd8fb5ygovb5b5me",
"Created": "2024-06-11T18:15:15.480144817-05:00",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.0.0.0/24",
"Gateway": "10.0.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": true,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"ingress-sbox": {
"Name": "ingress-endpoint",
"EndpointID": "77c4d64919437f10fa8735351ce61b3759e894402e3aa964f4973fd29243c65b",
"MacAddress": "02:42:0a:00:00:02",
"IPv4Address": "10.0.0.2/24",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.driver.overlay.vxlanid_list": "4096"
},
"Labels": {},
"Peers": [
{
"Name": "9e0bc1a58044",
"IP": "10.0.0.28"
},
{
"Name": "6714cb6bf042",
"IP": "10.0.0.26"
}
]
}
]
Asking ChatGPT, it seems to think that everything is correct. Am I missing a step somewhere? What else do I need to do/try to get this working correctly?