Monday, June 10, 2019

Tip to Verify KubeDNS is Working From Host

Requirement:

Sometimes we need to verify KubeDNS is working from host OS( ie VM ).

Solution:

  • Find KubeDNS service IP address via command
kubectl run -i --tty busybox --image=busybox --restart=Never -- cat /etc/resolv.conf
  • install nc if necessary. ie yum install nc
  •  ie the IP address is 10.96.5.5 , then run while loop to check each KubeDNS pod is responding. You may get timeout or can't resolve error if one of the pods is not working
while true;do nc -vz 10.96.5.5 53;sleep 3; done
  • More debug details please refer K8S doc 

No comments: