I’m trying a new pattern, I’d like to integrate consul service discovery domain/records into an existing zone.
I’ve done
TLD → Delegate .consul, works
TLD → Delegate .different.domain, works
what I’m looking to achieve is integrating the $service.$datacenter component into an existing top level domain.
eg: an engineering domain of localeng.com, all infrastructure is served on localeng.com (or where appropriate subdomain) but server1.localeng.com, server2.localeng.com etc.
This domain is served by bind (or core dns depending)
in the past in bind I’ve done
# consul service description
zone "consul" IN {
type forward;
forward only;
forwarders { 127.0.0.1 port 8600; };
};
which forward all .consul domains to consul, and presents services on $service.$datacenter.consul
what I’d like to do is present the service on $service.datacenter.localeng.com (or even better service.localeng.com)
The two questions
a.) what should the subdomain bind forwards to for delegation be
b.) what domain should consul listen on (using consul alt-name or domain parameters)
eg: for bind I need to set something to delegate at to consul, it can’t be localeng.com as that’s the TLD it serves itself, so should it be $datacenter.localeng.com eg: lab1.localeng.com) assuming a service would be helloworld.lab1.localeng.com that seems the only logical approach to me
for consul - what domain should it listening on, should it listen on localeng.com (the top level domain) too, as it will prepend $service+$datacenter, that seems a bit odd though to me from a pure dns point of view, but that said, I see no other way to do this, as if you set it to listen on $datacenter.localeng.com, then it should prefix $service.$datacenter.$datacenter.localeng.com ?
is what I want to do even possible ? I’m assuming if it’s not possible I have to do something that setups up a cname for $service.localeng.com to $service.$datacenter.additional.localeng.com