shell执行 kubectl edit configmap coredns -n kube-system
添加如下 host字段
data: Corefile: | .:53 { errors health { lameduck 5s } ready kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa ttl 30 } hosts { 192.168.1.2 hostname fallthrough } prometheus :9153 forward . /etc/resolv.conf cache 30 loop reload loadbalance }