Interview Prep/Kubernetes/Services, DNS, Ingress and NetworkPolicy

CoreDNS Pods are in CrashLoopBackOff with `[FATAL] plugin/loop: Loop (127.0.0.1:41823 -> :53) detected for zone "."`.

IntermediateTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer

Likely causes → CoreDNS forwards to the node's /etc/resolv.conf, which points at a local stub resolver (127.0.0.53 from systemd-resolved). Inside the CoreDNS Pod that address is CoreDNS itself, creating a loop.

Diagnose →

kubectl logs -n kube-system -l k8s-app=kube-dns --previous
# On the node
cat /etc/resolv.conf
grep resolvConf /var/lib/kubelet/config.yaml

Fix → Point the kubelet at the real upstream file: resolvConf: /run/systemd/resolve/resolv.conf, restart kubelet and CoreDNS. Or set forward . 10.0.0.2 (your VPC/upstream resolver) in the Corefile instead of /etc/resolv.conf.

Prevent → Set resolvConf correctly in the node bootstrap for Ubuntu/systemd-resolved hosts.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, DNS, Ingress and NetworkPolicy