Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes吊舱无法解析Internet地址_Kubernetes_Coredns - Fatal编程技术网

Kubernetes吊舱无法解析Internet地址

Kubernetes吊舱无法解析Internet地址,kubernetes,coredns,Kubernetes,Coredns,我已经在我的家庭实验室1 master和2 Node中使用Ubuntu16.04上的kubeadm构建了一个Kubernetes集群,其中Calico作为CNI。所有节点都可以在其控制台上解析internet地址,但我注意到的问题是,我部署的POD无法访问internet。CoreDNS似乎工作正常。也就是说,我是否需要在Kubernetes集群上进行任何特定的操作或配置,以便我部署的吊舱在默认情况下可以访问internet cloudadmin@vra-vmwlab-cloud-vm-318:

我已经在我的家庭实验室1 master和2 Node中使用Ubuntu16.04上的kubeadm构建了一个Kubernetes集群,其中Calico作为CNI。所有节点都可以在其控制台上解析internet地址,但我注意到的问题是,我部署的POD无法访问internet。CoreDNS似乎工作正常。也就是说,我是否需要在Kubernetes集群上进行任何特定的操作或配置,以便我部署的吊舱在默认情况下可以访问internet

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
在此方面的任何帮助都将不胜感激。谢谢

问题已解决

文件中提到了以下内容:

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
让iptable看到桥接流量
确保br_netfilter模块已加载。这可以通过运行lsmod | grep br|u netfilter来完成。要显式加载它,请调用sudo modprobe br_netfilter。
作为Linux节点的iptables正确查看桥接流量的要求,您应该确保在sysctl配置中将net.bridge.bridge-nf-call-iptables设置为1,例如。

cat I将尝试在这里完成以下步骤:是否您的节点设置了防火墙规则以阻止传出流量?我认为@Howard_Roark有一个很好的观点,检查常见问题始终是第一步。之后。。。关于CNI有很多东西需要学习;)我已经完成了Howard Roark的故障排除步骤。包括主节点在内的所有节点上都禁用了FW。我可以从节点上很好地解决问题,但不能从我部署的吊舱1上解决问题。你的kubernetes和calico版本是什么?2.你能试着在其他图像上做这些测试,而不是在busybox上吗?据我所知,busybox不适当地尊重DNS设置。3.你能试试其他CNI吗?4.是否已将
--pod网络cidr
添加到kubeadm init命令中?
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
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