From b7973ebb4cc6229d58df096575d3d9d9dcdace5f Mon Sep 17 00:00:00 2001 From: Anthony Corbacho Date: Thu, 10 Aug 2023 16:15:37 +0900 Subject: [PATCH 1/2] doc: Add example of setting up traefik IngressRoute with externalDNS annotations --- docs/tutorials/traefik-proxy.md | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/tutorials/traefik-proxy.md b/docs/tutorials/traefik-proxy.md index 7b83a1a7c9..dec41164a1 100644 --- a/docs/tutorials/traefik-proxy.md +++ b/docs/tutorials/traefik-proxy.md @@ -94,3 +94,46 @@ spec: - --registry=txt - --txt-owner-id=my-identifier ``` + +## Deploying a Traefik IngressRoute +Create a IngressRoute file called 'traefik-ingress.yaml' with the following contents: +```yaml +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: traefik-ingress + annotations: + external-dns.alpha.kubernetes.io/target: traefik.example.com + kubernetes.io/ingress.class: traefik +spec: + entryPoints: + - web + routes: + - match: Host(`application.example.com`) + kind: Rule + services: + - name: service + namespace: namespace + port: port +``` + +Note the annotation on the IngressRoute (`external-dns.alpha.kubernetes.io/target`); use the same hostname as the traefik DNS. + +ExternalDNS uses this annotation to determine what services should be registered with DNS. + +Create the IngressRoute: + +``` +$ kubectl create -f traefik-ingress.yaml +``` + +Depending where you run your IngressRoute it can take a little while for ExternalDNS synchronize the DNS record. + +## Cleanup + +Now that we have verified that ExternalDNS will automatically manage Traefik DNS records, we can delete the tutorial's example: + +``` +$ kubectl delete -f traefik-ingress.yaml +$ kubectl delete -f externaldns.yaml +``` From d5e97fa8a284e5e865a64cea9b39b4c0ef01e3b5 Mon Sep 17 00:00:00 2001 From: Anthony Corbacho Date: Thu, 10 Aug 2023 16:41:32 +0900 Subject: [PATCH 2/2] Update docs/tutorials/traefik-proxy.md Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> --- docs/tutorials/traefik-proxy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/traefik-proxy.md b/docs/tutorials/traefik-proxy.md index dec41164a1..2223a53c0e 100644 --- a/docs/tutorials/traefik-proxy.md +++ b/docs/tutorials/traefik-proxy.md @@ -108,6 +108,7 @@ metadata: spec: entryPoints: - web + - websecure routes: - match: Host(`application.example.com`) kind: Rule