-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cluster networking is broken? #24
Comments
@liyimeng can you ensure the br_netfilter module is loaded. The agent is supposed to load this module but it seems to not always work. I'm troubleshooting that now. |
@liyimeng FYI, it you are running in a container you need bind mount in |
I do have it loaded
When I do a troubleshooting like this: `
/ # nslookup hostnames ** server can't find hostnames.default.svc.cluster.local: NXDOMAIN *** Can't find hostnames.svc.cluster.local: No answer / # nslookup hostnames.default Kubernetes-managed hosts file.127.0.0.1 localhost ? (10.42.0.1) at 4e:b8:bd:7b:10:7b [ether] on eth0 how strange it is, I actually can reach the hostnames service when run wget, but nslookup failed. I guess it is something wrong on forwarding the packet from pod to service, or wise verse. Do we have tube-proxy or ipvs to map between service and pods? |
OK, I see that we use kube-proxy, at least iptables for this. String enough, nslookup work on the host! ` Name: www.google.com nslookup: can't resolve 'hostnames.default.svc.cluster.local': Name does not resolve |
BTW, ip forwarding is on
|
@liyimeng is there any way I can reproduce your setup? |
@ibuildthecloud Here is what I have done:
|
Seen the same issue when installing on an existing system. When running on a clean install, there are no issues. After some testing, the issue appears to be in having existing iptables rules that have a default |
In a fresh installation over CentOS 7.5 I'm getting the same issue:
My firewalld configuration:
br_netfilter module is loaded:
Which extra rules do I have to configure to get it working? |
I've not used firewalld before, but essentially you need to add a rule equivalent to this iptables rule:
This rule says, permit incoming packets from interface (bridge) |
I've added the rule and core-dns logs way less errors (although there are still some) but helm-install-traefik continues crashing continuously with the same error. Do I need another rule for it? |
Does firewalld have a log somewhere of what packets it is blocking or a way to enable such a log? If so, look there to see what might still be getting dropped. |
I'm seeing this with VMWare Photon 3.0. Adding @aaliddell's snippet to |
@briandealwis can you please point out which exact snippet you are referring to? |
|
I'm having the same problems. From inside a pod, (busybox) the dns is configured as 10.43.x.x but no interface of that name is created. I start the server with
without disabling the coredns service. But my machine shows no interface with range 10.43.x.x:
|
The 10.43.0.0/16 range is the default service ClusterIP range, which isn't actually bound to any interface but is instead a 'virtual' ip that is routed by iptables to a pod backing the service: https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-iptables You can change the service ip range with |
Thanks for your responses! I added my cidr network to the firewall (accept rules show up there). Still, after uninstalling k3s and reinstalling with
I still get errors related to DNS. After the startup I tail the logs from coredns doing a
From the server logs:
WhenI try to do a nslookup from buysbox:
So it seems DNS is not working properly... |
Pings to 10.43.0.0/16 addresses aren't going to respond, due to them being 'virtual' and only really existing within iptables. If your DNS requests are getting to the CoreDNS pod, then cluster networking looks like it's working. Your issue may be related to #53 (how on earth did a DNS problem get issue number 53...) |
In fact the coredns isn't able to reach out to 1.1.1.1:53. I changed it according to #53 and now its working!! Thanks! BTW: you're right on the issue number. What a nice coincidence! |
To anyone running into this issue on Fedora, the proper command to add the iptables rule is: firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 1 -i cni0 -s 10.42.0.0/16 -j ACCEPT and then a Still having issues with DNS resolving though. |
Fedora 29 these fixed both CoreDNS and Traefik install for me:
Might be possible to further narrow down or optimise the /15. |
Perfect timing! This worked like a charm for me on CentOS 7. 🍻 |
Getting the same issue with multi nodes k3s. With only one node, everything work like a charm.
I'm playing with this command My configTwo fresh Centos 7 launched on GCP with no firewall filtering between them. |
This issue topic is very broad and each person's setup is different and unique. I'd like to close the original issue and if you are still having networking issues, can you open a new issue. Ideally the subject is something that indicates what OS you are using, what version, and something specific about how the networking is broken. Thanks for understanding! |
The narrow solution whould be However, KUBE-FORWARD table is updated quiclky, so previous command will work one time if you are quick enough. So you can use |
I had same error, and i spent some time to resolve it, even i reinstalled my OS, and tried with different kubes' versions. At the end the issue was firewalld. |
@deniseschannon it seems the same issue on k3os. |
Is it correct for ufw or am I the other way around :
|
@Lunik did you end up finding a solution for this ?? i am having the same problem. |
In case if you are having a similar issue, I notice there were rules related to docker in my chains. (I was using containerd). The steps I have followed:
|
On fedora 31 I found the simplest thing to do was:
(edit: fix random space in -i) |
@kbrowder would you mind reviewing that command? Im on Fedora31 and seeing this issue but when I try your command it says its not a valid ipv4 filter command. |
there was just a typo in his command it says besides that it works for me on centos8 |
@maci0, woops, you're right, I edited my response above, sorry for the delay @jbutler992 |
I would just like to summarize this post by clearly stating the two iptables rules, taken from above, whose fixed my broken fresh install of k3s in a matter of (a fraction of) a second, after several days of struggling with it:
Many many thanks to you all for your contribution! |
This is an old thread, but I still want to share this to potentially save someone days of frustration. I had a private network of |
Thank you, kind sir. That hint saved me a ton of time! |
Thanks you ! |
helm install job never succeed, it seem that it is not possible to reach dns server.
Verify by running a busy box
The text was updated successfully, but these errors were encountered: