I have a very weird issue that prevent cert-manager working inside kubernetes inside docker for desktop.
To give you some context :
I have a basic domain for local development :
@ A 127.0.0.1
* A 127.0.0.1
_acme-challenge TXT xxxxxxxxxxxxxxxxxxxxx
I run this dns query on windows, I have this result (the expected one)
dig cname _acme-challenge.domain.dev.
; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> cname _acme-challenge.domain.dev.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30141
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;_acme-challenge.domain.dev. IN CNAME
;; AUTHORITY SECTION:
domain.dev. 78 IN SOA desi.ns.cloudflare.com. dns.cloudflare.com. 2304297281 10000 2400 604800 3600
;; Query time: 0 msec
;; SERVER: 172.28.208.1#53(172.28.208.1) (UDP)
;; WHEN: Tue Mar 14 18:02:22 CET 2023
;; MSG SIZE rcvd: 116
Now If I run this dns query from a pod inside the k8s cluster I have this result :
dig cname _acme-challenge.domain.dev.
; <<>> DiG 9.9.5-9+deb8u19-Debian <<>> cname _acme-challenge.domain.dev.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34937
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_acme-challenge.domain.dev. IN CNAME
;; ANSWER SECTION:
_acme-challenge.domain.dev. 5 IN CNAME _acme-challenge.domain.dev.
;; Query time: 3 msec
;; SERVER: 10.96.0.10#53(10.96.0.10)
;; WHEN: Tue Mar 14 17:01:
The CNAME record does not exists and creates an infinite loop in cert-manager.
I’m discussing with some people at CoreDNS to find the root cause of this issue here : DNS response is different when I use my os dns and when I use CoreDNS · coredns/coredns · Discussion #5971 · GitHub
It seems that this has something to do on how the cluster is working with docker for desktop.
Any idea on how to solve this in order to have cert-manager working properly when using Kubernetes with docker for desktop with windows 11 ?