Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudFlare provider continuously recreates apex records #4720

Open
BrianHicks opened this issue Sep 3, 2024 · 6 comments
Open

CloudFlare provider continuously recreates apex records #4720

BrianHicks opened this issue Sep 3, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@BrianHicks
Copy link

What happened: I have external-dns configured to source from ingresses. This works wonderfully, and all the records get created. However, it updates records for the domain apexes on every run, saying that no hosted zone matches.

What you expected to happen: I expected that external-dns would not change any records that already exist and are in the correct state without filtering out apex-level A records.

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

The minimum I can find is adding an annotation pointing to a bare domain, then running external-dns in the following configuration:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns
  namespace: external-dns
spec:
  selector:
    matchLabels:
      app: external-dns
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: external-dns
    spec:
      containers:
      - args:
        - --source=ingress
        - --provider=cloudflare
        - --cloudflare-proxied
        - --cloudflare-dns-records-per-page=5000
        - --log-level=trace
        env:
        - name: CF_API_TOKEN
          valueFrom:
            secretKeyRef:
              key: apiToken
              name: cloudflare-api-key-ae738f46
        image: registry.k8s.io/external-dns/external-dns:v0.14.2
        name: external-dns
      serviceAccount: external-dns

Each update cycle looks like this (changing my domain to be example.com, for clarity):

time="2024-09-03T18:51:11Z" level=debug msg="no zoneIDFilter configured, looking at all zones"                                                                                                                     time="2024-09-03T18:51:11Z" level=debug msg="Skipping record example.com because no hosted zone matching record DNS Name was detected"
time="2024-09-03T18:51:11Z" level=info msg="Changing record." action=UPDATE record=example.com ttl=1 type=A zone=a424b0c212d2d7999b56932ce53a77fb
time="2024-09-03T18:51:12Z" level=info msg="Changing record." action=UPDATE record=example.com ttl=1 type=A zone=a424b0c212d2d7999b56932ce53a77fb
time="2024-09-03T18:51:12Z" level=info msg="Changing record." action=UPDATE record=example.com ttl=1 type=A zone=a424b0c212d2d7999b56932ce53a77fb
time="2024-09-03T18:51:12Z" level=info msg="Changing record." action=UPDATE record=example.com ttl=1 type=TXT zone=a424b0c212d2d7999b56932ce53a77fb

(Worth noting that I do expect to have three IPs for each name; that's fine.)

Anything else we need to know?: Nope, I don't think so!

Environment:

  • External-DNS version (use external-dns --version): 0.14.2
  • DNS provider: CloudFlare
@BrianHicks BrianHicks added the kind/bug Categorizes issue or PR as related to a bug. label Sep 3, 2024
@darren-recentive
Copy link

darren-recentive commented Sep 9, 2024

I've been around this repository long enough and this crops up time-to-time :)
If you're utilizing ingress-nginx there's a known bug, this might help #3799 (comment)

If you don't already, I'd set a Deployment strategy to avoid duplicate Pods or switch to ReplicaSet.

@BrianHicks
Copy link
Author

BrianHicks commented Sep 9, 2024 via email

@BrianHicks
Copy link
Author

oh, that second part of your comment didn't come in the email. Where would you recommend setting that configuration?

@darren-recentive
Copy link

oh, that second part of your comment didn't come in the email. Where would you recommend setting that configuration?

Set the Deployment strategy to Recreate to avoid duplicate Pods, see this repositories' helm chart configuration for example.

@BrianHicks
Copy link
Author

oh, I see. It's already set to that. This doesn't seem to be a Kubernetes object thing, but the behavior of external-dns within the pod.

@darren-recentive
Copy link

darren-recentive commented Sep 14, 2024

oh, I see. It's already set to that. This doesn't seem to be a Kubernetes object thing, but the behavior of external-dns within the pod.

That's 1 less thing to worry about.
Now I had presumed you were utilizing ingress-nginx, but you're utilizing traefik - is it this Helm chart perhaps https://github.com/traefik/traefik-helm-chart?

Some findings that may be helpful:

relevant in that both Issue Authors are using traefik for their Ingress Controllers and are seeing similar symptoms of recreated A records.

I'm not utilizing traefik or enternal-dns for managing A records, so I can't reproduce, hope this helps though! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants