Kubernetes PODs cant Resolve Internet addresses

1.8k views Asked by At

i have built a Kubernetes Cluster using kubeadm on Ubuntu 16.04 in my home lab 1 master and 2 nodes with Calico as the CNI. all nodes can resolve internet addresses on its consoles but the issue i m noticing that the pods i deploy dont have access to the internet. CoreDNS seems to work fine . that being said is there anything specific i need to do or configure on the Kubernetes cluster so the pods i deploy have access to the internet by default?

cloudadmin@vra-vmwlab-cloud-vm-318:~$ kubectl exec -ti busybox -- nslookup kubernetes.default
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name:      kubernetes.default
Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local
cloudadmin@vra-vmwlab-cloud-vm-318:~$ kubectl exec -ti busybox -- ping google.com
ping: bad address 'google.com'
from the busybox Pod i can see its pointing to the right dns ip but still it cant reach google.com as you see above
cloudadmin@vra-vmwlab-cloud-vm-318:~$ kubectl exec -ti busybox -- sh
/ # cat /etc/resolv.conf

nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local vmwlab.local
options ndots:5
1

There are 1 answers

0
Maher AlAsfar On

Issue fixed ..

in the documentation https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ it mentions the following :

Letting iptables see bridged traffic 
Make sure that the br_netfilter module is loaded. This can be done by running lsmod | grep br_netfilter. To load it explicitly call sudo modprobe br_netfilter.

As a requirement for your Linux Node's iptables to correctly see bridged traffic, you should ensure net.bridge.bridge-nf-call-iptables is set to 1 in your sysctl config, e.g.

cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system

I also chose to use Weave Net instead of calico as the CNI