Skip to content

Add LOCAL_DOMAIN config from env variable#20

Closed
lalyos wants to merge 1 commit intogliderlabs:masterfrom
lalyos:custom-domain
Closed

Add LOCAL_DOMAIN config from env variable#20
lalyos wants to merge 1 commit intogliderlabs:masterfrom
lalyos:custom-domain

Conversation

@lalyos
Copy link
Contributor

@lalyos lalyos commented Jan 30, 2016

With this config, I could mimic for example a multihost consul/registrator setup, by defining node.dc1.consul as LOCAL_DOMAIN

@tilgovi
Copy link

tilgovi commented Feb 18, 2016

When you say "mimic", do you mean you're trying not to run consul and registrator, too?

@lalyos
Copy link
Contributor Author

lalyos commented Feb 18, 2016

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.

@tilgovi
Copy link

tilgovi commented Feb 18, 2016

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 . as a host unto itself?

If you take your example, .node.dc1.consul points to a node, not a container on a node.

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?

@lalyos
Copy link
Contributor Author

lalyos commented Feb 18, 2016

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.

@tilgovi
Copy link

tilgovi commented Feb 18, 2016

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.

@tilgovi
Copy link

tilgovi commented Feb 18, 2016

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?

@progrium
Copy link
Contributor

No new thoughts on this one. Perhaps @mgood has some.

@lalyos
Copy link
Contributor Author

lalyos commented Feb 19, 2016

@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

@lalyos lalyos closed this Feb 19, 2016
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

Successfully merging this pull request may close these issues.

3 participants