Closed lalyos closed 8 years ago
When you say "mimic", do you mean you're trying not to run consul and registrator, too?
Yes I meant that on a single host the containers can "feel" like they are in a multihost consul/registrator environment.
But that just one spefic use case, i also wanted to give the same freedom like consul gives you when it comes to domain name.
I'm not sure this makes sense for a project like resolvable. It's not really host-aware. It's a single-host tool until paired with other things. Do you think it's appropriate to treat
If you take your example,
Maybe if we can talk about a use case from the perspective of the application configuration.
To me, it seems like if you want to mimic a consul setup for an application, what you really want is short names to resolve automatically. For that, you could just start containers with --dns=<host ip if resolvable is --net host, otherwise resolvable container ip> --dns-search=docker
, no?
To me, it seems like ... what you really want is short names to resolve automatically.
Yes, but with reverse DNS lookup.
You are right, In most case auto registered short names which are resolvable to an ip is sufficient. But some software (especially in java world) try to figure out the fqdn by the ip address. So I need PTR records.
Surely i can solve the issue with consul + registrator, or maybe the upcoming "docker dns" will be similar. I just wanted to use resolvable, as I prefer to have 1 container instead of 2.
But again even if my use case seems strange, this PR is simply only makes a fixed string configurable by an environment variable.
When I discussed the configurable domain name idee with @progrium, he was even surpised its not already configurable.
Looking at #19, I wonder if this actually already works for you if you set the hostname of the container to <name>.node.dc1.consul
.
I just checked and actually resolvable only adds the short hostname as an alias. If it used the full hostname then I think it would just work from the container config rather than making it a resolvable-wide config.
@progrium whatcha think?
No new thoughts on this one. Perhaps @mgood has some.
@tilgovi
Looking at #19, I wonder if this actually already works for you if you set the hostname of the container to
.node.dc1.consul
Ohhh right! Actually that was implemented in #22, and I just realize that this PR is not needed. So closing this in favor of #22
With this config, I could mimic for example a multihost consul/registrator setup, by defining
node.dc1.consul
asLOCAL_DOMAIN