aks coredns quick debugging to see if the dns is working as expected
Use this yaml
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: registry.k8s.io/e2e-test-images/jessie-dnsutils:1.3
command:
- sleep
- "infinity"
imagePullPolicy: IfNotPresent
restartPolicy: Always
Next you can start to
Check default dns server
kubectl exec -i -t dnsutils -- nslookup kubernetes.default
Check /etc/resolv.conf file
kubectl exec -ti dnsutils -- cat /etc/resolv.conf
It should look like this:-
search default.svc.cluster.local svc.cluster.local cluster.local google.internal c.gce_project_id.internal
nameserver 10.0.0.10
options ndots:5
Other steps to confirm
Is the coredns pods running?
kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
Is the service up?
kubectl get svc --namespace=kube-system
Is the endpoint exposed?
kubectl get endpoints kube-dns --namespace=kube-system
Check corends pods for logs
kubectl logs --namespace=kube-system -l k8s-app=kube-dns
Comments