I am running a k3s cluster on some raspberry pi 4, in my local network. I have a DNS server (dnsmasq) on the master nodes. I want that the pods of my cluster use that DNS server, via coredns. However when I ping an adress from within a pod I always pass via the google DNS servers and overpass my local DNS rules.
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
}
this is my coredns config. As you see there is the forward . /etc/resolv.conf
my /etc/resolv.conf
domain home
nameserver 127.0.0.1
Any suggestions ?