You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DNS-Resolution of external domains not working inside pods
Since today (2024-07-08) I've a problem with DNS-Resolution inside pods running in a k3d-cluster.
But as soon as I comment-out the file-plugin inside the coredns-custom ConfigMap the problem goes away.
But without the file-plugin the dns-resolution of host.k3d.internal cannot work.
K3D Version:
❯ k3d version
k3d version v5.7.0
k3s version v1.29.6-k3s1 (default)
The Problem:
I can't resolve any external domain, here is an example with google.com
After a bunch of try and error (because i really don't know coredns that well). It turned out that the problem seams to be rooted inside the coredns configuration. When I remove the file-plugin inside the coredns-custom-ConfigMap it is working again:
❯ k3d cluster create test
INFO[0000] Prep: Network
INFO[0000] Created network 'k3d-test'
INFO[0000] Created image volume k3d-test-images
INFO[0000] Starting new tools node...
INFO[0000] Starting node 'k3d-test-tools'
INFO[0001] Creating node 'k3d-test-server-0'
INFO[0001] Creating LoadBalancer 'k3d-test-serverlb'
INFO[0001] Using the k3d-tools node to gather environment information
INFO[0001] HostIP: using network gateway 172.21.0.1 address
INFO[0001] Starting cluster 'test'
INFO[0001] Starting servers...
INFO[0001] Starting node 'k3d-test-server-0'
INFO[0005] All agents already running.
INFO[0005] Starting helpers...
INFO[0005] Starting node 'k3d-test-serverlb'
INFO[0011] Injecting records for hostAliases (incl. host.k3d.internal) and for 2 network members into CoreDNS configmap...
INFO[0013] Cluster 'test' created successfully!
INFO[0013] You can now use it like this:
kubectl cluster-info
2.Create POD with DNS-Utils (for Testing)
❯ kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml
pod/dnsutils created
3.1. Lookup google.com using nslookup inside dnsutils-pod:
DNS-Resolution of external domains not working inside pods
Since today (2024-07-08) I've a problem with DNS-Resolution inside pods running in a k3d-cluster.
But as soon as I comment-out the
file
-plugin inside thecoredns-custom
ConfigMap the problem goes away.But without the
file
-plugin the dns-resolution ofhost.k3d.internal
cannot work.K3D Version:
The Problem:
I can't resolve any external domain, here is an example with
google.com
But
host.k3d.internal
is working just fine (which means coredns is doing it's thing):How to "fix" the Problem:
After a bunch of try and error (because i really don't know
coredns
that well). It turned out that the problem seams to be rooted inside thecoredns
configuration. When I remove thefile
-plugin inside thecoredns-custom
-ConfigMap it is working again:coredns-custom
ConfigMap withfile
-plugincoredns-custom
ConfigMap and comment-out thefile
-pluginfile
-plugin is commented-out incoredns-custom
configmapHow to Reproduce:
2.Create POD with DNS-Utils (for Testing)
3.1. Lookup
google.com
usingnslookup
insidednsutils
-pod:3.2. Lookup
host.k3d.internal
usingnslookup
insidednsutils
-pod:Workaround:
As a workaround i've added the hosts from the zone-file inside
coredns-custom
configmap to thehost
-plugin insidecoredns
configmap:The text was updated successfully, but these errors were encountered: