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

PoC Core DNS with DNSRecord #358

Closed
4 tasks done
maleck13 opened this issue Jan 27, 2025 · 1 comment
Closed
4 tasks done

PoC Core DNS with DNSRecord #358

maleck13 opened this issue Jan 27, 2025 · 1 comment
Assignees

Comments

@maleck13
Copy link
Contributor

maleck13 commented Jan 27, 2025

What

DNS Operator leverages the kuadarnt DNSRecord CR. It should be possible to create a Kuadrant plugin for core dns that allows core dns to source records from our DNSRecord CR. The goal here is to prove we can integrate DNSRecord with Core DNS, identify any potential issues. If successful the outcome here would be a working PoC with a none load balanced DNSPolicy and issues for follow up work to bring the PoC to a "beta" level.

Prior Art: https://github.com/k8gb-io/coredns-crd-plugin

Done

  • Understand what is involved in compiling a plugin into Core DNS
  • Proof of Concept plugin that can serve basic DNS (without any geo or weighting applied) using our merged DNSRecord CRD
  • Identify how we can debug and see logs from our plugin
  • Remaining Work Items defined to bring the PoC to a beta level where it is tested and usable

Remaining A poc that handles:

  • Handling CNames
  • Handling wildcards
  • For multi value dnsnames - return the first one in the list
  • Basic docs for getting the POC working
@mikenairn mikenairn moved this to In Progress in Kuadrant Jan 27, 2025
@maleck13 maleck13 changed the title Look at adding a plugin for DNSRecord [Spike] Look at adding a plugin for DNSRecord Jan 28, 2025
@maleck13 maleck13 changed the title [Spike] Look at adding a plugin for DNSRecord PoC plugin for DNSRecord Jan 29, 2025
@philbrookes philbrookes changed the title PoC plugin for DNSRecord [Spike] plugin for DNSRecord Jan 30, 2025
@maleck13 maleck13 changed the title [Spike] plugin for DNSRecord PoC plugin for DNSRecord Feb 13, 2025
@maleck13 maleck13 changed the title PoC plugin for DNSRecord PoC Core DNS plugin for DNSRecord Feb 13, 2025
@maleck13 maleck13 changed the title PoC Core DNS plugin for DNSRecord PoC Core DNS with DNSRecord Feb 13, 2025
@mikenairn
Copy link
Member

mikenairn commented Feb 20, 2025

POC branch is here https://github.com/Kuadrant/dns-operator/tree/coredns.

It contains a CoreDNS plugin that adds the "kuadrant" directive allowing it be added to the CoreDNS Corefile. The plugin will watch for any DNSRecords being created/updated/deleted in any configured namesapces (default is all) that have a label added that corresponds to the zone name in the Corefile:

Example Corefile:

k.example.com {
   kuadrant
}

Example Record:

apiVersion: kuadrant.io/v1alpha1
kind: DNSRecord
metadata:
  name: api-k-example-com
  labels:
    kuadrant.io/zone-name: k.example.com
spec:
  rootHost: api.k.example.com
  endpoints:
    - dnsName: rapi.k.example.com
      recordTTL: 60
      recordType: A
      targets:
        - 1.1.1.1
  providerRef:
    name: dns-provider-credentials-coredns

Example response:

dig @172.18.0.16 api.k.example.com A +short
1.1.1.1

The plugin makes use of the CoreDNS file plugin to do much of the heavy lifting in providing us with a functioning DNS Server, but some modifications were required https://github.com/mikenairn/coredns/tree/add_rrresolver

The plugin also handles recursively resolving CNAMES, so we can get a response we would expect from a dns server when working with our loadbalanced (geo/weighted) records:

dig @172.18.0.16 api.k.example.com A +short
klb.api.k.example.com.
geo-eu.klb.api.k.example.com.
cluster2.klb.api.k.example.com.
127.0.0.2

@mikenairn mikenairn moved this from In Progress to Ready For Review in Kuadrant Feb 20, 2025
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Kuadrant Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants