docker-archive / classicswarm

Swarm Classic: a container clustering system. Not to be confused with Docker Swarm which is at https://github.com/docker/swarmkit
Apache License 2.0
5.75k stars 1.08k forks source link

DNS discovering service with same name in another stack #2949

Closed markwylde closed 5 years ago

markwylde commented 5 years ago

I'm not sure if this is a bug or by design, but it's not having the result I would expect.

I would have expected that if I haven't referenced another stack, it would always default to the service inside of my stack?

Anyway, for now I can just give all services a unique name. Just wanted to check if this is a bug or expected?

The images below use Alpine links. You can install dig by running apk update && apk install bind-tools

Stack One:

version: "3.7"

services:
  web-one:
    image: tutum/hello-world
  web-two:
    image: tutum/hello-world

networks:
  default:
    external: true
    name: someoverlaynetwork

Stack Two:

version: "3.7"

services:
  web-one:
    image: tutum/hello-world

networks:
  default:
    external: true
    name: someoverlaynetwork

When I dig web-one from the web-two service in stack one I see:

/ # dig web-one

; <<>> DiG 9.10.4-P8 <<>> web-one
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33978
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;web-one.           IN  A

;; ANSWER SECTION:
web-one.        600 IN  A   10.0.0.50
web-one.        600 IN  A   10.0.0.55

;; Query time: 0 msec
;; SERVER: 127.0.0.11#53(127.0.0.11)
;; WHEN: Sun Jun 23 13:02:07 UTC 2019
;; MSG SIZE  rcvd: 71

10.0.0.50 is actually two_web-one 10.0.0.55 is actually one_web-one (or what I would expect web-one to resolve to)

Am I missing something?

markwylde commented 5 years ago

Closing, as this doesn't belong in this repo.