Kubernetes 101 : Troubleshooting the DNS services - CoreDNS, kube-dns -
Checking the "coredns" deployment:
We could use the below command to display the deployment object that manages pods with "kube-dns" label in the "kube-system" namespace, to check if it is in a "ready" state:
Checking the "coredns" pods:
We can also display the pods in the "kube-system" namespace, that have the "k8s-app=kube-dns" label, to check if they are "running":
Checking the "kube-dns" ClusterIP service:
The address of the ClusterIP service that is handling the "kube-dns" pod needs to be the same as the nameserver in the "/etc/resolv.conf" file:
Re-deploying the CoreDNS pod:
Another solution to fix the service discovery issue is to delete the CoreDNS Pods.
They will be restarted by the deployment object that is managing them.
We delete the DNS pods using their label "kube-dns":
We delete the DNS pods using their label "kube-dns":
Comments