kubic-project / issues

Repository for storing issues and feature planning for Kubic
2 stars 1 forks source link

DNS resolution failure in pods #14

Open Iduoad opened 3 years ago

Iduoad commented 3 years ago

I installed Kubic using Kubic-terraform-libvirt.

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"archive", BuildDate:"2021-04-09T16:47:30Z", GoVersion:"go1.16.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-25T00:00:00Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

Everything went well! but pods can't resolve DNS.

 # k run -it --rm --image praqma/network-multitool net -- nslookup kubernetes.default
;; connection timed out; no servers could be reached

I followed the guide on Kubernetes docs, and everything seems to be well.

 # k get pods -n kube-system -l k8s-app=kube-dns
NAME                       READY   STATUS    RESTARTS   AGE
coredns-7cccf9b6b5-f97wv   1/1     Running   0          55m
coredns-7cccf9b6b5-qc2nb   1/1     Running   0          55m

# k get svc -n kube-system -l k8s-app=kube-dns
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   56m

#  k run -it --rm --image praqma/network-multitool net -- cat /etc/resolved.conf
search default.svc.cluster.local svc.cluster.local cluster.local kubic.local
nameserver 10.96.0.10
options ndots:5

# k get endpoints kube-dns --namespace=kube-system
NAME       ENDPOINTS                                               AGE
kube-dns   10.244.0.2:53,10.244.0.3:53,10.244.0.2:53 + 3 more...   62m

# k logs --namespace=kube-system -l k8s-app=kube-dns
.:53
[INFO] plugin/reload: Running configuration MD5 = db32ca3650231d74073ff4cf814959a7
CoreDNS-1.8.0
linux/amd64, go1.16.4,
.:53
[INFO] plugin/reload: Running configuration MD5 = db32ca3650231d74073ff4cf814959a7
CoreDNS-1.8.0
linux/amd64, go1.16.4,
thkukuk commented 3 years ago

Is IP forwarding enabled for all devices? So even eth0 (or the persistent name of it) and so on? This is the most common reason for why DNS resolving does not work.