Docker swarm deploy fails with 'Pool overlaps with other one'

Viewed 102

I have a working docker container, that I can run successfully using its docker-compose.yml already.

Now trying to switch to docker swarm init.

Result: when I try to deploy to docker swarm, my container startup fail with Pool overlaps with other one. What could be the problem?

docker stack deploy -c docker-compose.yml docker-test

I'm not creating any networks myself, just relying on the docker defaults:

#installed networks by docker + docker-compose + docker swarm

$docker network ls
NETWORK ID     NAME                   DRIVER    SCOPE
4d523758a775   bridge                 bridge    local
ac8774f0119e   docker_gwbridge        bridge    local
ea0ehx9k5kxu   docker-test_default    overlay   swarm
12a2cf29c55b   host                   host      local
tbshoxat5bdg   ingress                overlay   swarm
01aff819ac80   none                   null      local

$ docker stack ls
NAME           SERVICES   ORCHESTRATOR
docker-test    1          Swarm

$docker stack ps docker-test
ID             NAME                            IMAGE                                 NODE   DESIRED STATE   CURRENT STATE             ERROR                              PORTS
43q3xo0y5smv   test-docker_test-docker.1       docker-repo:5000/test-docker:latest   dev    Shutdown        Rejected 10 minutes ago   "Pool overlaps with other one …"   
x158nyonghbt    \_ test-docker_test-docker.1   docker-repo:5000/test-docker:latest   dev    Shutdown        Rejected 11 minutes ago   "Pool overlaps with other one …"   
4hsis6wslfl1    \_ test-docker_test-docker.1   docker-repo:5000/test-docker:latest   dev    Shutdown        Rejected 11 minutes ago   "Pool overlaps with other one …"   
50y8rspynoxu    \_ test-docker_test-docker.1   docker-repo:5000/test-docker:latest   dev    Shutdown        Rejected 11 minutes ago   "Pool overlaps with other one …"   

docker-compose.yml:

version: '3.7'
services:
  docker-test:
    image: docker-repo:5000/docker-test:latest
    deploy:
      replicas: 1
      update_config:
        order: start-first
        failure_action: rollback
        delay: 10s

Logs:

$journalctl -fu docker.service
-- Logs begin at Sun 2022-01-16 17:20:01 CET. --
Apr 05 14:16:34 dev dockerd[416253]: time="2022-04-05T14:16:34.484292037+02:00" level=info msg="initialized VXLAN UDP port to 4789 "
Apr 05 14:16:34 dev dockerd[416253]: time="2022-04-05T14:16:34.588014714+02:00" level=error msg="fatal task error" error="Pool overlaps with other one on this address space" module=node/agent/taskmanager node.id=ak88o55xp7uk1bqsocd0ieb1y service.id=8i6n17sognrtvqopzarfdmd17 task.id=x158nyonghbtpalbtlv5nycmr
1 Answers

It was probably that my docker config looked as follows in cat /etc/docker/daemon.json:

{
       ...
       "default-address-pools":
       [
               {
                       "base": "10.0.0.0/16",
                       "size": 24
               }
       ]
}

This probably conflicted with the docker-swarm network. I changed the above to 11.0.0.0/16, then used docker system prune to clear all networks, followed again by a docker swarm init.

Related