Hints: dns-resolution¶
Hint 1¶
Services can't resolve DNS names. Test from inside a pod:
- kubectl exec -n grokdevops <pod> -- nslookup kubernetes.default
Hint 2¶
The issue is in the cluster DNS layer. Check CoreDNS:
- kubectl get pods -n kube-system -l k8s-app=kube-dns
- kubectl logs -n kube-system -l k8s-app=kube-dns --tail=10
Hint 3¶
Check resolv.conf and CoreDNS configuration:
- kubectl exec -n grokdevops <pod> -- cat /etc/resolv.conf
- kubectl get cm -n kube-system coredns -o yaml
- Is the nameserver IP correct? Is the CoreDNS config valid?
Hint 4¶
Common fixes: restart CoreDNS pods (kubectl rollout restart deployment coredns -n kube-system), fix the Corefile if it has syntax errors, or check that the kube-dns Service ClusterIP matches resolv.conf.