busybox dns resolve not works in some nodes in kuberenetes

2/13/2020

I am deploy 3 busybox(1.28.3) in 3 nodes in kubernetes cluster(v1.15.2),each node contain a pod , this is my yaml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: busybox-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: busybox
    spec:
      restartPolicy: Always
      containers:
      - name: busybox
        command:
        - sleep
        - "3600"
        image: busybox:1.28.3

when I login to each pod and execute nslookup:

nslookup kubernetes.default.svc.cluster.local

only one node response correct:

/ # nslookup kubernetes.default.svc.cluster.local
Server:    10.254.0.2
Address 1: 10.254.0.2 kube-dns.kube-system.svc.cluster.local

Name:      kubernetes.default.svc.cluster.local
Address 1: 10.254.0.1 kubernetes.default.svc.cluster.local

the other 2 node response like this:

/ # nslookup kubernetes.default.svc.cluster.local
Server:    10.254.0.2
Address 1: 10.254.0.2

nslookup: can't resolve 'kubernetes.default.svc.cluster.local'

why the CoreDNS(1.3.1) not works in some nodes?

-- Dolphin
kubernetes

1 Answer

2/14/2020

There could be multiple issues for this. Some common troubleshooting steps are:

  • Checking local DNS configuration
  • Checking core-dns pods and its logs

You can follow the DNS resolution debugging (https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/) page for detailed troubleshooting guide.

-- anmol agrawal
Source: StackOverflow