How Can I Add a CNAME Record in CoreDNS?

0
2
Asked By CuriousPenguin45 On

I'm trying to figure out how to add a CNAME record in CoreDNS for my Kubernetes cluster. I'm deploying some applications, but my last Helm pod won't start because it gives an error: `nginx: [emerg] host not found in resolver 'kube-dns.kube-system.svc.cluster.local'`. According to Rancher's documentation, my cluster is using CoreDNS instead of kube-dns. I can't access the pod's shell to change the configuration, so I think I need to add a CNAME in CoreDNS to make it point to the actual DNS. I've identified that I should probably edit the `/etc/coredns/Corefile`. My questions are: 1. There are two CoreDNS pods; do I need to update both or will changes sync automatically? 2. What's the right syntax for adding a CNAME in the Corefile? I can't find helpful examples. 3. I've seen advice about replacing the entire yaml file to update CoreDNS; is that the best way to make DNS changes? 4. Am I overlooking anything else as someone who's new to Kubernetes but not infrastructure in general?

1 Answer

Answered By KeenDev92 On

It's important to note that CoreDNS is actually referred to as kube-dns in some contexts. The CoreDNS service name is kube-dns for compatibility with older workloads. However, just because it’s named kube-dns, it doesn’t mean it functions like the older kube-dns; CoreDNS might not resolve `kube-dns.kube-system.svc.cluster.local` as you expect. Make sure to troubleshoot from that angle too!

ThinkingCap77 -

Thanks for pointing that out! I checked the CoreDNS pod, and yes, it resolved its own name but not the kube-dns address. That leads me to believe there's some misconfiguration.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.