mesos-dns icon indicating copy to clipboard operation
mesos-dns copied to clipboard

srv port lookup not the same as configured network

Open f1-outsourcing opened this issue 4 years ago • 0 comments

I am launching a task with two networks.

"networks": [ 
	{ "mode": "container", "name": "cni-apps" },
	{ "mode": "container", "name": "cni-apps-demo" }
  ]

And this comes from dns:

[@~]$ dig +short server.dev.marathon.mesos
192.168.124.51
192.168.122.56
[@ ~]$ dig +short srv _server.dev._tcp.marathon.mesos
0 1 31025 server.dev-34ktw-s4.marathon.mesos.
0 1 31024 server.dev-34ktw-s4.marathon.mesos.

After scaling this task to two instances

[@~]$ dig +short server.dev.marathon.mesos
192.168.122.56
192.168.124.53
192.168.122.59
192.168.124.51
[@~]$ dig @192.168.10.14 +short  srv _server.dev._tcp.marathon.mesos
0 1 31025 server.dev-34ktw-s4.marathon.mesos.
0 1 31807 server.dev-m5ocg-s4.marathon.mesos.
0 1 31806 server.dev-m5ocg-s4.marathon.mesos.
0 1 31024 server.dev-34ktw-s4.marathon.mesos.

I think all the srv need to be unique, on this page[1] you can see in the example that the srv is having unique records. The reason for them to be all unique is that you have to specify what port is on what network[2]

This gives me the port

[@ ~]$ dig +short srv _metrics._server.dev._tcp.marathon.mesos
0 1 31025 server.dev-34ktw-s4.marathon.mesos.

And connecting will give me 2! Networks

[@~]$ ping server.dev-34ktw-s4.marathon.mesos.
PING server.dev-34ktw-s4.marathon.mesos (192.168.122.56) 56(84) bytes of data.
[@~]$ ping server.dev-34ktw-s4.marathon.mesos.
PING server.dev-34ktw-s4.marathon.mesos (192.168.124.51) 56(84) bytes of data.

Which is not according to the required configuration networkNames as in

{"hostPort": 0, "name": "health", "protocol": "tcp", "networkNames": ["cni-apps"] },
{"hostPort": 0, "name": "metrics", "protocol": "tcp", "networkNames": ["cni-apps"] }

f1-outsourcing avatar Aug 13 '20 20:08 f1-outsourcing