我在本地网络中的某个树莓派 4 上运行 k3s 集群。我在主节点上有一个 DNS 服务器 (dnsmasq)。我希望我的集群的 pod 通过 coredns 使用该 DNS 服务器。但是,当我从 pod 中 ping 一个地址时,我总是通过谷歌 DNS 服务器并超越我的本地 DNS 规则。
apiVersion: v1
kind: ConfigMap
data:
Corefile: |
.:53 {
errors
health
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
}
hosts /etc/coredns/NodeHosts {
reload 1s
fallthrough
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
这是我的 coredns 配置。如您所见,有forward . /etc/resolv.conf
我的 /etc/resolv.conf
domain home
nameserver 127.0.0.1
有什么建议么 ?