Open samip5 opened 3 years ago
So this is a bit of an open question because external-dns doesn't have multiple provider support (that I'm aware of). I added very basic support, where every single endpoint that gets pulled in by a source is equally eligible to be exported to each configured provider. I currently only offer annotation filters at the source level.
As far as adding multiple providers, I actually have an example, which includes zone filters to be a bit more explicit: https://github.com/cloudydeno/kubernetes-dns-sync/blob/6fb5d81c32a535a75c43037752d084f722841c76/examples/complex.toml#L14-L20
In your example, configuring both providers today would result in iot.home.example.org
getting created in both providers, given that the parent zones already exist in both. I have a similar zone layout & I personally run two copies of this program, with different annotation-filters on each instance. So one instance acts as an internet
instance and the other as a vpn
instance. This works because these instances have different source and provider configurations.
I'm open to ideas on how to solve this with a single instance, but I also have some of my own:
Allow for further annotation filtering at the provider
side.
node
source in this configuration. This solution wouldn't be applicable to my current usage.Automatically recognize nested zones and prevent matching records from being presented to a less-specific zone.
Optionally allow a source
definition to include a "context" of sorts, which places the endpoints into a non-default list which only a provider
definition with a matching "context" will pick up. So you'd have two different source blocks with your different annotation filters.
Maybe some sort of zone or provider priority thing, so that records are only given to the highest-priority zones that somehow match them. This is like a non-automatic version of idea 2.
Allow for blocking a particular list of names from being managed by a provider, including child names. In your example, this would involve adding home.example.org to the block list for the Cloudflare provider. This can be forgotten easily but I feel it could be quite robust, as the providers don't need to interact to provide this feature.
I left this alone for a bit... I want to release a 1.0 in the next month or so, and one last feature I want to add is a better method of configuring the controller.
I'm now leaning towards defining a new CRD which provides a single dns-sync configuration (a list of sources + providers, and a registry). Secrets could be referenced directly for credentials, like if there's two different Cloudflare accounts. You'd then be able to create multiple CRD resources to have parallel universes of DNS records from one dns-sync
instance.
If I take this approach I'll probably keep TOML config support as well (at least thru 1.x) just because it's a bit easier to test and get going.
For more background, there's a wishlist ticket on external-dns
about working with CRD configurations: https://github.com/kubernetes-sigs/external-dns/issues/1961
Hi,
How is it going? It seems the repo hasn't had activity in a while.
Please document how to utilize your application with multiple providers.
I would like to do the following:
home.example.org => PowerDNS, if annotation filter allows example.org => Cloudflare, if annotation filter allows
Similar how you can in external-dns do public=true annotations and only then push it to Cloudflare.