d2iq-archive / mesos-dns

DNS-based service discovery for Mesos.
https://mesosphere.github.com/mesos-dns
Apache License 2.0
483 stars 137 forks source link

DNS SRV entries need port names to be addressable ... PORT_NAME.SERVICE.PROTOCOL.FRAMEWORK.MESOS #458

Closed RichardHightower closed 7 years ago

RichardHightower commented 8 years ago

Mesos DNS maps marathon apps (called service below as follow).

SERVICE.PROTOCOL.FRAMEWORK.MESOS

should also be include

SERVICE.PROTOCOL.FRAMEWORK.MESOS
PORT_NAME.SERVICE.PROTOCOL.FRAMEWORK.MESOS

Each port name should be mapped.

Example: I have a service that looks up another service using DNS SVR record, i.e., ServiceOne Looks up MyService _myservice._tcp.marathon.mesos. It communicates with mesos-dns fine… ServiceOne get a list of URIs for myservice, i.e., (myservice-j8bny-s0.marathon.mesos:14353, myservice-abcdef-s0.marathon.mesos:12032).

The issue is I have two port definitions for this service as follows:

"portDefinitions": [
    {
      "name": "eventbus",
      "port": 0,
      "protocol": "tcp"
    },
    {
      "name": "admin",
      "port": 0,
      "protocol": "tcp"
    }
  ],

The problem is that I only want the eventbus port but I am getting eventbus ports and admin ports.

i.e, dig _eventbus._myservice._tcp.marathon.mesos SRV instead of dig _myservice._tcp.marathon.mesos SRV .

Currently mesos dns creates

_myservice._tcp.marathon.mesos

It is unlikely that you would use this for client side service discovery because there is no way to see if the ports are the ones you want.

Currently mesos dns should create

_myservice._tcp.marathon.mesos
_eventbus._myservice._tcp.marathon.mesos
_admin._tcp.marathon.mesos

So

SERVICE.PROTOCOL.FRAMEWORK.MESOS

should also be include

PORT_NAME.SERVICE.PROTOCOL.FRAMEWORK.MESOS
jdef commented 7 years ago

478