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

Use DNSEndpoint for all records #4859

Open
lucasfcnunes opened this issue Nov 8, 2024 · 0 comments
Open

Use DNSEndpoint for all records #4859

lucasfcnunes opened this issue Nov 8, 2024 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@lucasfcnunes
Copy link

lucasfcnunes commented Nov 8, 2024

What would you like to be added:

Use the kind DNSEndpoint for all generated DNS records.

  • When a service, ingress, etc needs to have their records created, it should always trigger the creation of a respective DNSEndpoint with a ownerReferences[0] self-reference in it.
  • The resource in ownerReferences[0] shouldn't be used for anything but to generate the DNSEndpoint.
  • Only the DNSEndpoint should be used as the source of truth for the syncing of the records.

Example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: airflow-ingress
  namespace: airflow
  annotations:
    external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
spec:
  ingressClassName: nginx
  rules:
    - host: airflow.example.com
      http:
        paths:
          - backend:
              service:
                name: airflow-webserver
                port:
                  name: airflow-ui
            path: /
            pathType: ImplementationSpecific
    - # ...
status:
  loadBalancer:
    ingress:
      - ip: 123.4.5.6
---
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
  name: airflow-ingress
  namespace: airflow
  ownerReferences:
    - apiVersion: networking.k8s.io/v1
      blockOwnerDeletion: true
      controller: true
      kind: Ingress
      name: airflow-ingress
spec:
  endpoints:
    - dnsName: airflow.example.com
      recordType: A
      targets:
        - 123.4.5.6
      providerSpecific:
        - name: external-dns.alpha.kubernetes.io/cloudflare-proxied
          value: "true"
    - # ...
status:
  conditions:
    - lastTransitionTime: "2024-10-14T10:24:24Z"
      message: DNSEndpoint is up to date
      observedGeneration: 1
      reason: Ready
      status: "True"
      type: Ready
  notAfter: "2025-01-12T09:25:51Z"
  notBefore: "2024-10-14T09:25:52Z"
  renewalTime: "2024-12-13T09:25:51Z"
  revision: 1

Why is this needed:

  • Transparency on what external-dns is doing or trying to do with the domains
  • Keep track of all DNS records
  • Possibility of a detailed status for all records being synced
  • ownerReferences is used in multiple systems e.g. Argo CD to link related k8s resources
  • Possibility to kubectl get DNSEndpoint -A -o yaml and have the actual state of all managed records
  • Make external-dns flow more like what we see in cert-manager (DNSEnpoint <=> Certificate)
@lucasfcnunes lucasfcnunes added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant