Skip to content

Using Multiple Providers

Daniel Lamando edited this page Feb 26, 2022 · 4 revisions

The kubernetes-dns-sync daemon supports having multiple DNS provider blocks in a single configuration file.

When there are multiple providers, each of them are operated on individually. Each provider will receive the combined DNS names from all configured sources. So if a DNS zone exists in more than one provider, the relevant DNS records will get duplicated across them.

Limitations

Every configured provider will be given the same DNS records. It's not possible for one configuration to build different views of the same domain name.

This is relevant when building split-horizon / multi-view DNS setups. Each 'view' would need its own kubernetes-dns-sync deployment to filter out different set of records.

Multi-Provider Example

For example, let's say that you have these ingresses:

> kubectl get ingress --all-namespaces
NAMESPACE  NAME     CLASS      HOSTS           ADDRESS
blog       www-fe   internet   mychat.com      cdn.hosting.provider
chat       www-fe   internet   mychat.app      1.1.8.8
chat       api-fe   internet   api.mychat.app  1.1.8.8

These Ingress documents specify hosts underneath two different domain names. If your domain names aren't all hosted on the same DNS provider, e.g. if one uses AWS Route53 and the other Cloudflare, then kubernetes-dns-sync will still be able to manage both of your providers from the same instance.

A TOML configuration might look like this:

[[source]]
type = "ingress"

[[provider]]
type = "cloudflare"
proxied_by_default = true
domain_filter = [ "mychat.com" ]

[[provider]]
type = "route53"
domain_filter = [ "mychat.app" ]

[registry]
type = "txt"
txt_prefix = "_registry."
txt_owner_id = "mybrand-us-east1"

And that's it! The providers will be synced in order whenever an Ingress resource changes.

Note that domain_filter isn't required when setting up multiple providers. The filters help explain the provider layout to anyone looking at the configuration.

Clone this wiki locally