agentleFS
foxj77foxj77/claude-code-skills/external-dns-troubleshooting/SKILL.md

external-dns-troubleshooting

Skill19 starsChanged 10 months agoMITView on GitHub

Use when DNS records are not being created or updated for Kubernetes Services or Ingresses, when ExternalDNS logs show errors, when records are stale or orphaned, or when provider-specific sync failures occur

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the appropriate MCP servers are connected, prefer these over raw kubectl where available:

    line 270

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ExternalDNS Troubleshooting

Diagnose failures in ExternalDNS — the controller that synchronises Kubernetes Service/Ingress annotations to DNS providers (Route53, Azure DNS, CloudFlare, Google Cloud DNS, etc.).

Keywords

external-dns, externaldns, dns, records, route53, azure-dns, cloudflare, google-cloud-dns, dns-sync, dns-records, a-record, cname, txt-record, annotation, hostname, domain, zone, provider, registry, ownership

When to Use This Skill

  • DNS records are not being created for new Services or Ingresses
  • Existing DNS records are stale, pointing to old IPs
  • ExternalDNS logs show authentication, permission, or zone errors
  • TXT ownership records are missing or conflicting
  • Records appear in the log as "planned" but never created
  • DNS propagation seems broken after a provider migration
  • ExternalDNS is running but doing nothing (no changes detected)

When NOT to Use

  • DNS records exist but TLS certs are failing → use cert-manager-troubleshooting
  • DNS is working but the Service has no endpoints → use k8s-namespace-troubleshooting
  • ExternalDNS config is delivered by Flux and not appearing → use flux-troubleshooting

Related Skills

  • cert-manager-troubleshooting - TLS certificates depend on DNS
  • kyverno-troubleshooting - Policies may block annotations
  • external-secrets-troubleshooting - Provider credentials from external stores
  • k8s-namespace-troubleshooting - General namespace diagnosis
  • k8s-platform-operations - Cluster-wide operations
  • flux-troubleshooting - GitOps delivery of ExternalDNS config

Quick Reference

TaskCommand
Check ExternalDNS podkubectl get pods -n external-dns
View logskubectl logs -n external-dns deploy/external-dns --tail=200
List managed records (dry-run)kubectl logs -n external-dns deploy/external-dns | grep "Desired"
Check source annotationskubectl get ingress -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}\t{.metadata.annotations.external-dns\.alpha\.kubernetes\.io/hostname}\n{end}'
Find TXT ownership recordskubectl logs -n external-dns deploy/external-dns | grep "txt"
Force sync (recommend to user)kubectl rollout restart deploy/external-dns -n external-dns

Diagnostic Workflow

DNS record not appearing?
├─ ExternalDNS pod running?
│   ├─ No → Check deployment, image, RBAC (Section 1)
│   └─ Yes → Check logs for errors
│       ├─ Authentication/permission error → Fix provider credentials (Section 2)
│       ├─ Zone not found / filtered out → Fix domain filter config (Section 3)
│       ├─ Source yielded 0 endpoints → Fix annotations/sources (Section 4)
│       ├─ Record planned but not created → Provider API issue (Section 5)
│       └─ No log activity at all → Check interval and RBAC (Section 6)
├─ Record exists but wrong value?
│   ├─ TXT ownership record missing → Ownership conflict (Section 7)
│   └─ Multiple ExternalDNS instances → Registry conflict (Section 7)
└─ Record was deleted unexpectedly?
    └─ Orphaned record cleanup or ownership loss (Section 7)

Section 1: Controller Health

# Pod status
kubectl get pods -n external-dns -o wide
kubectl describe deploy/external-dns -n external-dns

# RBAC — ExternalDNS needs read access to Services, Ingresses, Nodes
kubectl auth can-i list services --as=system:serviceaccount:external-dns:external-dns
kubectl auth can-i list ingresses --as=system:serviceaccount:external-dns:external-dns

# Check arguments and configuration
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n'

Key Arguments to Verify

ArgumentPurposeCommon Mistake
--source=service,ingressWhat resources to watchMissing a source type
--domain-filter=example.comRestrict to specific domainsTypo in domain or too restrictive
--provider=awsDNS providerWrong provider name
--policy=upsert-onlyCreate/update but never deleteUsing sync deletes unmanaged records
--registry=txtOwnership trackingMissing registry causes conflicts
--txt-owner-id=my-clusterUnique owner per clusterDuplicate owner IDs across clusters
--interval=1mSync intervalToo long hides issues

Section 2: Provider Authentication

Full provider auth reference: See provider-authentication.md for generic diagnostic steps, auth method tables, and provider-specific issue matrices for AWS, Azure, GCP, Vault, and CloudFlare.

The commands below are ExternalDNS-specific. For general auth debugging patterns, use the shared reference.

# Quick auth check — grep ExternalDNS logs for auth failures
kubectl logs -n external-dns deploy/external-dns --tail=200 | grep -iE 'credential|auth|forbidden|access denied|assume role|sts|azure|authorization|cloudflare|google|permission'

Required Provider Permissions (ExternalDNS-Specific)

ProviderRequired Permissions
AWS Route53route53:ChangeResourceRecordSets, route53:ListResourceRecordSets, route53:ListHostedZones, route53:ListHostedZonesByName
Azure DNSDNS Zone Contributor on the zone resource group (or custom role with Microsoft.Network/dnsZones/*)
CloudFlareAPI token with Zone:DNS:Edit on target zones
Google Cloud DNSroles/dns.admin on the project (or dns.changes.create, dns.resourceRecordSets.*, dns.managedZones.list)

Section 3: Domain Filter and Zone Issues

# Check which domains ExternalDNS is configured to manage
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n' | grep -i domain

# Check if the target zone exists at the provider
kubectl logs -n external-dns deploy/external-dns --tail=200 | grep -iE 'zone|domain|filter'

# List all zones ExternalDNS can see
kubectl logs -n external-dns deploy/external-dns --tail=200 | grep -i "all hosted zones"
ProblemSymptom in LogsDiagnostic
Domain filter too strict"0 zones match" or skipped recordsCheck --domain-filter scope; recommend widening or adding --exclude-domains
Zone doesn't exist at provider"zone not found"Verify zone exists at the provider
Zone ID filter wrongRecords in wrong zoneCheck --zone-id-filter argument against provider zone IDs
Sub-domain not coveredParent zone exists but child not matchedCheck if sub-domain is included in domain filter

Section 4: Source and Annotation Issues

# Check which sources ExternalDNS watches
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n' | grep source

# Find Services with external-dns annotations
kubectl get svc -A -o json | jq -r '.items[] | select(.metadata.annotations["external-dns.alpha.kubernetes.io/hostname"] != null) | "\(.metadata.namespace)/\(.metadata.name)\t\(.metadata.annotations["external-dns.alpha.kubernetes.io/hostname"])"'

# Find Ingresses with hostnames
kubectl get ingress -A -o json | jq -r '.items[] | select(.spec.rules) | .metadata.namespace + "/" + .metadata.name + "\t" + (.spec.rules[].host // "no-host")'

# Check if source yields endpoints
kubectl logs -n external-dns deploy/external-dns --tail=200 | grep -i "endpoint"

Required Annotations (Services)

AnnotationPurposeExample
external-dns.alpha.kubernetes.io/hostnameTarget DNS nameapp.example.com
external-dns.alpha.kubernetes.io/ttlRecord TTL"300"
external-dns.alpha.kubernetes.io/targetOverride target IP/hostnamelb.example.com

Service Type Requirements

Service TypeExternalDNS Behaviour
LoadBalancerUses .status.loadBalancer.ingress for target IP/hostname
ClusterIPOnly works if --publish-internal-services is set
NodePortOnly works if --service-type-filter=NodePort and node IPs available
ExternalNameUses .spec.externalName as CNAME target

Common issue: LoadBalancer Service has no .status.loadBalancer.ingress yet — ExternalDNS cannot determine the target IP. Check if the cloud load balancer provisioned successfully.


Section 5: Record Creation Failures

# Check for planned vs applied changes
kubectl logs -n external-dns deploy/external-dns --tail=300 | grep -iE 'planned|create|update|delete|change|apply'

# Check for rate limiting
kubectl logs -n external-dns deploy/external-dns --tail=300 | grep -iE 'throttl|rate limit|429|too many'

# Check for provider API errors
kubectl logs -n external-dns deploy/external-dns --tail=300 | grep -iE 'error|fail|invalid|conflict'
ProblemSymptomDiagnostic
Planned but not applied"Creating" in logs, record missing at providerCheck if --dry-run flag is set in deployment args
Rate limited429 errors or "rate limit" messagesCheck --interval value and record count
Invalid record"invalid" or "validation" errorsCheck record name/value format for the provider
Conflicting record"conflict" or "already exists"TXT ownership mismatch — see Section 7

Section 6: No Activity

# Check sync interval
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n' | grep interval

# Check if watching the right namespace
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n' | grep namespace

# Check RBAC can list resources
kubectl auth can-i list services -A --as=system:serviceaccount:external-dns:external-dns
kubectl auth can-i list ingresses -A --as=system:serviceaccount:external-dns:external-dns

# Recent log entries (any activity at all?)
kubectl logs -n external-dns deploy/external-dns --tail=50 --since=10m
CauseCheckDiagnostic
--namespace flag restricts scopeArgs show --namespace=XCheck if namespace filter is intentional or too restrictive
RBAC too restrictiveauth can-i returns "no"Check ClusterRole permissions for services/ingresses/nodes
No annotated resources existServices/Ingresses lack annotationsCheck if external-dns.alpha.kubernetes.io/hostname annotation is present
Interval too longArgs show --interval=60mCheck --interval value; recommend reducing for faster feedback

Section 7: Ownership and Registry

ExternalDNS uses TXT records as an ownership registry to track which records it manages. Problems here cause records to be ignored, duplicated, or accidentally deleted.

# Check registry type and owner ID
kubectl get deploy/external-dns -n external-dns -o jsonpath='{.spec.template.spec.containers[0].args}' | tr ',' '\n' | grep -iE 'registry|owner'

# Look for ownership conflicts in logs
kubectl logs -n external-dns deploy/external-dns --tail=300 | grep -iE 'ownership|registry|txt|skip|ignore|conflict'
ProblemCauseDiagnostic
Record exists but ExternalDNS ignores itTXT record has different owner IDCompare --txt-owner-id with TXT record owner; check for mismatch
Multiple clusters fighting over recordsSame --txt-owner-id on different clustersCheck if each cluster has a unique owner ID
Records deleted unexpectedly--policy=sync removes unmanaged recordsCheck if --policy=sync is set; recommend upsert-only if unintended
Orphaned records after cluster deletionNo cleanup ranCheck provider console for orphaned DNS and TXT ownership records
TXT prefix collisionDefault prefix a- or cname- collidesCheck --txt-prefix for uniqueness

Provider-Specific Gotchas

ProviderGotchaDetail
Route53Private hosted zonesNeed --aws-zone-type=private and VPC association
Route53Alias recordsExternalDNS creates A records, not aliases — use --aws-prefer-cname for CNAME
Azure DNSResource group requiredMust specify --azure-resource-group
Azure DNSSubscription filterMulti-subscription needs --azure-subscription-id
CloudFlareProxy modeexternal-dns.alpha.kubernetes.io/cloudflare-proxied: "true" for orange cloud
CloudFlareZone ID vs nameAPI token must have access to the specific zone
Google Cloud DNSProject requiredMust specify --google-project
Google Cloud DNSManaged zone nameZone names differ from domain names

MCP Tools Available

When the appropriate MCP servers are connected, prefer these over raw kubectl where available:

  • mcp__flux-operator-mcp__get_kubernetes_resources - Query ExternalDNS deployment, pods, services, ingresses
  • mcp__flux-operator-mcp__get_kubernetes_logs - Retrieve ExternalDNS pod logs
  • mcp__flux-operator-mcp__get_kubernetes_metrics - Check ExternalDNS resource consumption

Common Mistakes

MistakeWhy It FailsInstead
Running --policy=sync without understanding itDeletes DNS records not managed by ExternalDNS, causing outagesStart with upsert-only; switch to sync only after auditing all existing records
Same --txt-owner-id across multiple clustersClusters overwrite each other's recordsUse a unique owner ID per cluster (e.g., cluster-name-region)
Forgetting --source=ingress when using IngressesExternalDNS only watches Services by default in some configsExplicitly list all source types: --source=service --source=ingress
Setting --dry-run and forgetting to remove itRecords are planned but never created — looks like a provider issueCheck args for --dry-run before investigating provider auth
Not checking LoadBalancer provisioningExternalDNS has no target IP to useVerify .status.loadBalancer.ingress is populated on the Service
Debugging DNS propagation before checking ExternalDNS logsWastes time on DNS caching when the record was never createdAlways check ExternalDNS logs first, then provider console, then DNS propagation

Behavioural Guidelines

  1. Check logs first — ExternalDNS is heavily log-driven; the answer is almost always in the logs.
  2. Verify annotations — Most "ExternalDNS isn't working" issues are missing or malformed annotations.
  3. Check the provider console — Confirm whether the record exists at the provider, not just via DNS lookup (caching).
  4. Never expose provider credentials — List secret names, never decode values.
  5. Understand the policy — upsert-only vs sync has dramatically different behaviour. Confirm which is set before troubleshooting deletions.
  6. Check owner IDs in multi-cluster setups — Ownership conflicts are silent; records just stop updating.
  7. Restart as a last resort — A rollout restart forces a full sync cycle, but diagnose the root cause first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.