This is my kubernetes(v1.15.2) cluster CoreDNS(1.3.1) config:
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
when I am scan from host,the result is:
the port 53 is avaliable, when I scan from pods:
the port 53 is unavaliable, how to explain this?what could I do to make it avaliable in pods?
You can scan CoreDNS port 53 in some pods,it shows your CoreDNS expose port is ok.The problem may be some pod in some host could not recieve CoreDNS response,check the kube-proxy log using this command to make sure the kube-proxy have no error and works fine:
journalctl -l -u kube-proxy|tail -n 120
kube-proxy is make sure your kubernetes cluster server forward to each backend pod,and refresh rule when pod ip changed.