Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesos-dns ip sorting for multi homed #1

Open
f1-outsourcing opened this issue Aug 24, 2023 · 2 comments
Open

mesos-dns ip sorting for multi homed #1

f1-outsourcing opened this issue Aug 24, 2023 · 2 comments

Comments

@f1-outsourcing
Copy link

Hi Andreas, how are you? ;)

I have something, but I am not sure if this is even interesting for you. I am using on mesos-dns on multiple networks 192.168.x.0, 192.168.y.0, 192.168.z.0. Not only because I try to be cheap on resources, but I also have 'resolvers' on such networks.

Problem that I have is that tasks on 192.168.z.0 are getting at random ip's of eg 192.168.z.0 and 192.168.y.0. Problem is of course when the task gets 192.168.y.0. Then routing fails.

named has a sorting solution for this.

       sortlist {
          192.168.y.0/24; {
             192.168.y.0/24;
             192.168.z.0/24;
             };
          192.168.z.0/24; {
             192.168.z.0/24;
             192.168.y.0/24;

Is it possible to adapt mesos-dns so it gives first all 192.168.z.0 to a request from a 192.168.z.0 network?

mesosphere/mesos-dns#556
https://github.com/AVENTER-UG/mesos-dns

@andreaspeters
Copy link
Member

Hi Marc,

I'm fine. How are you?

To your issue/idea. I think your idea make sense. I will have a look if I can add it.

@f1-outsourcing
Copy link
Author

Hi Marc,

I'm fine. How are you?

So, so, everything is so slow here because of the ig/chatgpt job hopping generation, dreaming about g wagons, while they don't realise that currently every generation has less than the one before.

To your issue/idea. I think your idea make sense. I will have a look if I can add it.

Currently it is nicely cycling these ranges, printing the next element[1]. However I can't really think of a reason why one would not like this to be sorted by 'network', except for maybe other tasks that are on multiple networks (like haproxy). Maybe it is best to enable/disable this via the configuration file[2]

Somehow you need to track via what interface the dns request was received, get the ip/subnet from that interface. Then when cycling through the result test if an entry is within the interface address space, if so put it on 1st, 2nd, 3rd etc position[3]. This way the result should still be randomized.

[3]

192.168.123.63
192.168.123.65
192.168.123.64
192.168.124.55
192.168.124.56
192.168.124.57

[2]

  "dnsinterfacesorting": true
}

[1]

[@test ~]# dig +short server.test.marathon.mesos
192.168.123.63
192.168.124.55
192.168.123.65
192.168.124.56
192.168.123.64
192.168.124.57
[@test ~]# dig +short server.test.marathon.mesos
192.168.124.55
192.168.123.65
192.168.124.56
192.168.123.64
192.168.124.57
192.168.123.63
[@test ~]# dig +short server.test.marathon.mesos
192.168.123.65
192.168.124.56
192.168.123.64
192.168.124.57
192.168.123.63
192.168.124.55
[@test ~]# dig +short server.test.marathon.mesos
192.168.124.56
192.168.123.64
192.168.124.57
192.168.123.63
192.168.124.55
192.168.123.65
[@test ~]# dig +short server.test.marathon.mesos
192.168.123.64
192.168.124.57
192.168.123.63
192.168.124.55
192.168.123.65
192.168.124.56
[@test ~]# dig +short server.test.marathon.mesos
192.168.124.57
192.168.123.63
192.168.124.55
192.168.123.65
192.168.124.56
192.168.123.64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants