I'm following https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md to setup AWS EKS cluster and managed to successfully setup cluster and a test nginx service running.
My domain is configured on Cloudflare and is used for different things i.e. domain.com lands static website, api.domain.com, app.domain.com, xyz.domain.com all are currently pointing to an IP address (LoadBalancer) on DigitalOcean Kubernetes that then handles everything and serves api and other requests accordingly.
How can I point multiple sub-domains to AWS using IP or some other way. Do I need to deploy external-dns multiple times (per sub domain)? or can I just deploy it once and use that for all sub domains? The problem here is part of external-dns config is to mention Route 53 ZoneID that is currently a subdomain
- --txt-owner-id=my-hostedzone-identifier
Okay, got the answer. First as documented in the external-dns documentation, run the command:
$ aws route53 create-hosted-zone --name "my-domain-here.com." --caller-reference "external-dns-mydomain-$(date +%s)"
Then I copied the NS records from Route53 for this new domain and added to cloudflare NS records in the DNS section. After that my K8s foo.my-domain-here.com started working!!
So moving forward, I won't need to register anything in the Route53 and just add NS record for bar.my-domain-here.com to point subdomains to EKS applications although the domain is registered on cloudflare and is being used for marketing and other sub domains,