Почему я не могу выставить порт-агент агента 9001? - PullRequest
0 голосов
/ 24 ноября 2018

Я пытаюсь выставить порт агента Portainer 9001 на кластере Swarm, чтобы получить доступ к нему от внешнего устройства Portainer, он развернут в «глобальном» режиме.

Работает следующий файл docker-compose:

version: "3.2"
services:
  agent:
    image: "portainer/agent:1.1.2"
    environment:
      AGENT_CLUSTER_ADDR: tasks.agent
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    networks:
      - priv_portainer
    deploy:
      mode: global

networks:
  priv_portainer:
    driver: overlay

Затем, когда я пытаюсь открыть порт 9001, запускается стек, но возникают ошибки журнала, и Portainer не может подключить следующие агенты:

version: "3.2"
services:
  agent:
    image: "portainer/agent:1.1.2"
    environment:
      AGENT_CLUSTER_ADDR: tasks.agent
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    ports:
      - "9001:9001"
    networks:
      - priv_portainer
    deploy:
      mode: global

networks:
  priv_portainer:
    driver: overlay

Событие с другим портом:

ports:
  - "19001:9001"

И даже с портом, который не имеет ничего общего:

ports:
  - "12345:54321"

РЕДАКТИРОВАТЬ

Журналы из стека:

portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:50 [INFO] serf: EventMemberJoin: b6040a1ccc2a 10.255.0.13 portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:50 [INFO] - Starting Portainer agent version 1.1.2 on 0.0.0.0:9001 (cluster mode: true) portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:50 [INFO] serf: EventMemberJoin: c6c277e3f60b 10.255.0.11 portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.11:7946: write udp [::]:7946->10.255.0.11:7946: sendto: operation not permitted portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.11:7946: write udp [::]:7946->10.255.0.11:7946: sendto: operation not permitted portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [INFO] serf: EventMemberJoin: 3e290151a5eb 10.255.0.12 portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.11:7946: write udp [::]:7946->10.255.0.11:7946: sendto: operation not permitted portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.12:7946: write udp [::]:7946->10.255.0.12:7946: sendto: operation not permitted portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.12:7946: write udp [::]:7946->10.255.0.12:7946: sendto: operation not permitted portainer_agent_agent.0.13cjb851d9me@ignochtulelk02d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.11:7946: write udp [::]:7946->10.255.0.11:7946: sendto: operation not permitted portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [INFO] serf: EventMemberJoin: 3e290151a5eb 10.255.0.12 portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [INFO] serf: EventMemberJoin: b6040a1ccc2a 10.255.0.13 portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [INFO] serf: EventMemberJoin: c6c277e3f60b 10.255.0.11 portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [INFO] - Starting Portainer agent version 1.1.2 on 0.0.0.0:9001 (cluster mode: true) portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.13:7946: write udp [::]:7946->10.255.0.13:7946: sendto: operation not permitted portainer_agent_agent.0.985h7xcfkux0@ignopotulelk03d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.11:7946: write udp [::]:7946->10.255.0.11:7946: sendto: operation not permitted portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:50 [INFO] serf: EventMemberJoin: c6c277e3f60b 10.255.0.11 portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:50 [INFO] serf: EventMemberJoin: b6040a1ccc2a 10.255.0.13 portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:50 [INFO] - Starting Portainer agent version 1.1.2 on 0.0.0.0:9001 (cluster mode: true) portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.13:7946: write udp [::]:7946->10.255.0.13:7946: sendto: operation not permitted portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.13:7946: write udp [::]:7946->10.255.0.13:7946: sendto: operation not permitted portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:51 [INFO] serf: EventMemberJoin: 3e290151a5eb 10.255.0.12 portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.13:7946: write udp [::]:7946->10.255.0.13:7946: sendto: operation not permitted portainer_agent_agent.0.mljirysir6px@ignopotulelk01d | 2018/11/26 05:28:51 [ERR] memberlist: Failed to send gossip to 10.255.0.12:7946: write udp [::]:7946->10.255.0.12:7946: sendto: operation not permitted

Когда я заменяю:

ports:
  - "9001:9001"

На:

- target: 9001
  published: 9001
  protocol: tcp
  mode: host

Работает, почему режим host решает эту проблему?

...