I followed the next guide https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/ in BareMetal Ubuntu 20.04 with 2 nodes.
I chose Docker as my Container Runtime and started the cluster with sudo kubeadm init --pod-network-cidr 10.16.0.0/16
Everything seems to run fine at the beginning The problem that I'm having is when a pod needs to connect to kube dns to resolve a domain name, although kubedns is working fine, so it seems that the problem is with the connection between.
I ran the debugging tool for the DNS https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ and when I ran kubectl exec -i -t dnsutils -- nslookup kubernetes
I got the following output:
This are the logs of my kube dns:
And this is the resolv.conf inside my pod:
This is my kubectl and kubeadm info:
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
kubeadm version: &version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:09:38Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
[edit with extra information]