Rancher override FQDN of container

Hi guys,

I’m trying to setup the Rancher external DNS service to create entries even though containers do not have publicly accessible ports. The reason is I have a load balancer (jwilder/nginx-proxy to be specific) in front of it.

I’d like to use labels / environment variables for each container to specify the A record that has to be created, even though the container itself has no public ports.

Is this possible? I looked at the code (https://github.com/rancher/external-dns) but was not able to find anything. Any tips greatly appreciated!

Edit: I have found the lines of code at https://github.com/rancher/external-dns/blob/master/metadata/metadata.go, however I’m not sure how to create this Rancher container now. The Dockerfile included does not seem to work. I managed to create the Go binary and replaced the file in rancher/external-dns:v.0.5.0 but that doesn’t seem to work :frowning:

Regards,
Gerwim

The intention of external-dns is to manage published services in a standardized format under a single root domain which you can then use as CNAME records to human-consumable domain names/subdomains.

What IPs would these records point to? The internal IPs (10.42.x.y) are useless externally and the public IPs of the hosts the containers are not (in general) the same as the ones where your nginx-proxy is running (maybe you make that true with scheduling rules). So you’d just be creating records which point to nothing useful.

Have you considered a record like *.mydomain.com CNAME nginxproxy.stack.env.managed-by-externaldns.com?

Hi Vincent,

Thanks for your reply.

What IPs would these records point to

To the host’s external IPv4 address. Since I’m running multiple websites in each container, I’m not publishing port 80, I’m exposing it for the nginx proxy to be a reverse proxy since I have one IPv4 address per physical host.

So, I’d like to set an environment variable or label for the container and the external-dns container should create it.

If you have building guidelines on how to build the external-dns container myself, then please share them with me. I tried to build the container from scratch but to no avail (seems like some stuff is missing from the GitHub repo).

Thanks in advance!