Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
Understanding overlay networks in docker

Please help me get this right,

An overlay network in swarm mode allows cross-node containers to be able see each other as on the same network.
Is that right?

So if I had the following setup:

  • swarm-mode cluster of two similar nodes M (manager) and W (worker)
  • two containers CM and CW running on nodes M and W respectively
  • CM depends_on: - CM:target
  • both containers are connected the an overlay network OVNET

Would I be able to ping target from CM? If not, why?


Demo: docker stack deploy -c test.yml test where test.yml is as follows:

version: "3"
services:
  CM:
    image: alpine
    command: sh -c 'ping CW'
    depends_on:
      - CW
    networks:
      - OVNET
    deploy:
      placement:
        constraints:
          - node.role == manager
  CW:
    image: alpine
    command: sh -c 'ping localhost'
    networks:
      - OVNET
    deploy:
      placement:
        constraints:
          - node.role == worker
networks:
  OVNET:
    driver: overlay

Thnaks in advance!

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Yes, it works as you would expect. The network is created first, then the containers are placed according to their constraints. I would expect that the first instance of CM might fail as CW would need time to pull the image but after that would work fine. Containers on the same overlay network can talk to each other via their service names over the in-built DNS.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda