Docker Community Forums

Share and learn in the Docker community.

Containers on different nodes unreachable with user namespace remapping enabled


(Shaunblake) #1

I’m wondering if anyone here can point me in the right direction.

I’ve enabled user namespace remapping on two rhel machines and then created a new swarm. When I deploy the stack below, the containers can’t reach each other.

If I then disable user namespace remapping and restart docker on each host, then set up the same swarm and stack again, they can reach each other just fine.

Does anyone know what the problem might be?

Here’s stack and commands I run:

test.yml

version: "3.3"
services:
  nginx-host1:
    image: nginx:alpine
    deploy:
      placement:
        constraints:
          - node.hostname == host1.whatever
  nginx-host2:
    image: nginx:alpine
    deploy:
      placement:
        constraints:
          - node.hostname == host2.whatever
          

Then to test:

user@host1:$ docker stack deploy -c test.yml test
user@host1:$ docker exec -it test_nginx-host1.1.<id> /bin/ash
apk add --update drill curl
drill nginx-host2
curl nginx-host2 #Host is unreachable when user namespace remap is enabled.