Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Mesos-DNS should not try and guess it's IP #379

Closed
cmaloney opened this issue Dec 9, 2015 · 6 comments
Closed

Mesos-DNS should not try and guess it's IP #379

cmaloney opened this issue Dec 9, 2015 · 6 comments

Comments

@cmaloney
Copy link

cmaloney commented Dec 9, 2015

Running / deploying DCOS we've found that software does not have a simple / reliable way to get the "correct" IP address for the host. Trying to do a reverse lookup on the hostname doesn't work (hostnames aren't set right or there isn't a global set of reverse-DNS entries). Looking up the default network route doesn't work (the network applications on top of DCOS should talk on is set to the default network, Mesos is expected to talk on a different network), as well as a number of other scenarios.

We ship every host in DCOS with exactly the same static configuration. This makes some problems (such as upgrading), a lot easier since every host doesn't have "magic" per-host extra state, as well as making our installs a lot more reliable (All that happens on host is the extraction of a big tarball then running tested code).

It is also important to note we run all the software through systemd, and systemd does not itself interpret bash statements in Exec lines (it will do environment variable substitution, but no subcommand execution).

To allow sysadmins to configure "what IP should DCOS system software on a given host run with" we have them right an ip-detect script which when run will output the IP address the software should listen on. In AWS for instance, this will do something like ask the AWS metadata service what the local IPv4 Address is (curl -fsSL http://169.254.169.254/latest/meta-data/local-ipv4). The script always takes no arguments, and outputs one (and only one) IPv4 address to stdout. If the address is not a valid IPv4 address or more than just the IPv4 address and whitespace is output, the software calling the ip-detect script should error and exit.

Mesos-DNS needs to gain the ability to run this ip-detect script to figure out its ip. This can be through some generic mechanism (ex: If an argument begins with @exec: the given script will be executed) or only for this one particular case (Gain a ip_detect_filename argument). I generally don't like having the ability to do arbitrary code injection, but in this case it is the best option at present, so prefer something towards the latter, but am fine with either.

@cmaloney cmaloney added the bug label Dec 9, 2015
@jdef
Copy link
Contributor

jdef commented Dec 9, 2015

@sargun are we still using milestones for mesos-dns? If so should this be added to 1.0?

@sargun sargun added this to the v1.0.0 milestone Dec 14, 2015
@sargun
Copy link
Contributor

sargun commented Dec 16, 2015

Just curious - which IP is given for ip_detect? If the system has multiple IPs?

@cmaloney
Copy link
Author

Entirely up to the sysadmin, whatever they think is most appropriate for Mesos internal communication.

@sargun
Copy link
Contributor

sargun commented Dec 24, 2015

Do we recommend that people supply an IP that's routable?

@cmaloney
Copy link
Author

The answer is it's the right IP to use for their datacenter. We build out a preflight check harness to ensure that it's a IP that works correctly.

@jdef
Copy link
Contributor

jdef commented Jul 12, 2017

#504 #501

@cmaloney cmaloney closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants