agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/external-dns/SKILL.md

external-dns

Skill4 starsChanged 5 months agoMITView on GitHub

Use when working with ExternalDNS — synchronizing Kubernetes resources with DNS providers (Cloudflare). Covers providers, sources, registry, RBAC, Gateway API integration, Helm values. No CRDs.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    upsert-only doesn't clean up stale records: When an Ingress/HTTPRoute is deleted, its DNS record persists.

    line 180
  2. Very specific:

    Multiple TXT owner IDs on same zone: If two ExternalDNS instances manage the same zone with different txtOwnerId, they can coexist.

    line 185

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Overview

ExternalDNS synchronizes exposed Kubernetes Services, Ingresses, and Gateway API routes with DNS providers. It watches resources via the K8s watch API and creates/updates/deletes DNS records to match.

No CRDs. Controlled via CLI flags, sources, and provider-specific config.

Latest: chart 1.21.1, app v0.21.0.

Architecture

K8s Sources (Ingress, HTTPRoute, Service...)
  → ExternalDNS watches for changes
    → Resolves to DNS endpoints
      → Creates/updates/deletes DNS records (Cloudflare, Route53, etc.)
        → Registry (TXT records) tracks ownership

Sources

ExternalDNS queries one or more source types for DNS endpoints:

SourceFlagSupported
Ingress--source=ingress✅
Service (LoadBalancer)--source=service✅ (no NodePort)
Gateway HTTPRoute--source=gateway-httproute✅
Gateway GRPCRoute--source=gateway-grpcroute✅
Gateway TLSRoute--source=gateway-tlsroute✅ (v1alpha2)
Gateway TCPRoute--source=gateway-tcproute✅ (experimental)
Gateway UDPRoute--source=gateway-udproute✅ (experimental)
Istio Gateway--source=istio-gateway✅
Istio VirtualService--source=istio-virtualservice✅
CRD--source=crd✅ (externaldns.k8s.io/v1alpha1)
Node--source=node✅
Pod--source=pod✅
OpenShift Route--source=openshift-route✅
Contour HTTPProxy--source=contour-httpproxy✅
Traefik Proxy--source=traefik-proxy✅

Deployed sources: ingress, gateway-httproute.

Providers

ExternalDNS supports 25+ providers. Deployed: Cloudflare.

Cloudflare

Auth via API token (env var CF_API_TOKEN). Example values:

provider:
  name: cloudflare
env:
  - name: CF_API_TOKEN
    valueFrom:
      secretKeyRef:
        name: cloudflare-credentials
        key: api-token
extraArgs:
  - --cloudflare-proxied

Cloudflare-specific flags:

FlagDescription
--cloudflare-proxiedEnable Cloudflare proxy (orange cloud) — CDN, DDoS protection, SSL
--cloudflare-dns-records-per-page=NRecords per page (default 100, max 5000)
--cloudflare-custom-hostnamesEnable Cloudflare for SaaS Custom Hostnames
--cloudflare-regional-servicesRestrict HTTPS decryption to specific regions
--cloudflare-region-keyRegion key for regional services
--cloudflare-record-commentAdd comment to provisioned records (≤100/≤500 chars)

Registry & Policy

Controls how ExternalDNS tracks ownership of records:

registry: txt          # Use TXT records to track ownership
txtOwnerId: my-cluster # Owner identifier in TXT record
policy: upsert-only    # Only create/update, never delete
RegistryDescription
txtTXT records with owner ID (prevents overwriting records from other sources)
awsAWS Route53 tag-based (provider-specific)
noopNo ownership tracking
PolicyDescription
upsert-onlyCreate and update only (safe for shared zones)
syncFull sync — create, update, delete (can delete external records)
create-onlyOnly create, never update or delete

Domain & Ownership Filtering

domainFilters:
  - example.com        # Only manage records in this zone
excludeDomains: []     # Exclude specific domains
zoneIdFilters: []      # Limit to specific zone IDs
annotationFilter: ""   # Filter resources by annotation
labelFilter: ""        # Filter resources by label

Gateway API Integration

ExternalDNS reads hostnames from Gateway API HTTPRoute/GRPCRoute resources:

sources:
  - gateway-httproute
  - gateway-grpcroute

RBAC for Gateway sources requires additional permissions:

rbac:
  extraRules:
    - apiGroups: ["gateway.networking.k8s.io"]
      resources: ["httproutes", "gateways"]
      verbs: ["get", "watch", "list"]

HTTPRoute annotations for per-route overrides:

metadata:
  annotations:
    external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
    external-dns.alpha.kubernetes.io/ttl: "300"

Deployment (Flux HelmRelease)

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
spec:
  chart:
    spec:
      chart: external-dns
      sourceRef:
        kind: HelmRepository
        name: external-dns
      version: 1.21.1

Helm Values

ValueDefaultDescription
provider.nameawsDNS provider (cloudflare, google, aws, azure, etc.)
sources[service, ingress]Resources to watch (ingress, gateway-httproute, service, etc.)
domainFilters[]Limit to specific DNS zones
policyupsert-onlySync policy (upsert-only, sync, create-only)
registrytxtOwnership registry (txt, aws, noop)
txtOwnerId—Owner identifier for TXT registry
interval1mSync interval
logLevelinfoLog verbosity
rbac.createtrueCreate ClusterRole
rbac.extraRules[]Additional RBAC rules (e.g. for Gateway API)
nodeSelector{}Node selector
tolerations[]Pod tolerations
extraArgs[]Additional CLI args

Common Mistakes

  • Missing RBAC for Gateway sources. Without rbac.extraRules, gateway-httproute source returns no endpoints. Both httproutes and gateways resources must be listed.
  • upsert-only doesn't clean up stale records. When an Ingress/HTTPRoute is deleted, its DNS record persists. Use sync policy or manual cleanup.
  • Cloudflare API token needs specific permissions. Requires Zone:DNS:Edit for the target zone. A token with only Zone:Read will fail silently.
  • --cloudflare-proxied is a global flag. To proxy only specific records, omit the global flag and use the external-dns.alpha.kubernetes.io/cloudflare-proxied: "true" annotation per resource.
  • Domain filter is a suffix match. example.com matches app.example.com but NOT example.com.app.com. Add trailing dot if needed.
  • NodePort services not supported with source=service. Only LoadBalancer services are detected.
  • Multiple TXT owner IDs on same zone. If two ExternalDNS instances manage the same zone with different txtOwnerId, they can coexist. Records with unknown owner ID are left untouched by upsert-only.

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.