kubernetes-sigs / external-dns

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Apache License 2.0
7.58k stars 2.54k forks source link

Non-wildcard DNS record is unmanaged when combining with wildcard subdomain #3768

Open aardbol opened 1 year ago

aardbol commented 1 year ago

What happened: When defining both a non-wildcard record with a wilcard one, both DNS records will be created but only the wildcard version will continue to be maintained by external-dns.

e.g. teleport requires both sub.domain.tld and .sub.domain.tld to be defined, so they are for the LoadBalancer k8s service: `external-dns.alpha.kubernetes.io/hostname: "teleport.domain.tld,.teleport.domain.tld"`

external-dns then creates both A records that point to the correct service IP: *.teleport.domain.tld. 1.1.1.1 teleport.domain.tld. 1.1.1.1

It also creates the following TXT records: txt-*.teleport.domain.tld. "heritage=external-dns,external-dns/owner=project-id,external-dns/resource=service/teleport/teleport-cluster" txt-a-*.teleport.domain.tld. "heritage=external-dns,external-dns/owner=project-id,external-dns/resource=service/teleport/teleport-cluster"

Now if the LB service IP changes, only the wildcard A record will be updated: *.teleport.domain.tld. 1.1.1.2 teleport.domain.tld. 1.1.1.1

What you expected to happen: Both records to be kept in sync

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?: Logs (note, the IPs have been changed to match the example):

time="x" level=debug msg="Skipping endpoint teleport.domain.tld 0 IN A  1.1.1.2 [] because owner id does not match, found: \"\", required: \"project-id\""
time="x" level=debug msg="Skipping endpoint teleport.domain.tld 300 IN A  1.1.1.1 [] because owner id does not match, found: \"\", required: \"project-id\""

Environment:

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

aardbol commented 7 months ago

/remove-lifecycle stale

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

rwong2888 commented 3 months ago

/remove-lifecycle stale

rwong2888 commented 3 months ago

i have a similar issue. is there any solution for this?

rwong2888 commented 3 months ago

i removed txt-prefix which helps. only complains about a-foo.bar.com zone not existing now

rwong2888 commented 3 months ago

now it is looping between deleting and adding

rwong2888 commented 3 months ago

resolved by keeping txt-prefix and creating 2 new zones for me

k8s-triage-robot commented 2 weeks ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

aardbol commented 1 week ago

/remove-lifecycle stale