-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Minikube to host communication not working on Fedora 37 #15573
Comments
Full output of |
hmm, do we know if was docker the one to drop the port? I've seen a recent report in kubernetes about some weird iptables rules being mutated in Centos |
@mnk thanks for reporting this issue there are a couple of improvements i'm currently working on in draft pr #15463 could you please try with https://storage.googleapis.com/minikube-builds/15463/minikube-linux-amd64 and let us know if it works for you if not, could you pull that pr and run:
then share the whole output you get i've tried to replicate your setup (ie, fresh fedora 37 install [in kvm] + docker) and all the tests above passed for me, so i'm curious to know if it would work for you |
@prezha , I tried the minikube build you linked to, but I still get the same result - no Do you get the My use-case can be tested by starting sshd on the host and then doing |
@aojea as mentioned on the PR I also see no dport currently, on gLinux (~debian): $ docker run -d --entrypoint=sleep --network=kind --privileged --name=aaa kindest/node:v1.25.3 infinity
07cc1460e1bf62a936e33775efdda0fbce577634eb06b07dcdd267bd855f9248
$ docker exec --privileged aaa iptables-save
# Generated by iptables-save v1.8.7 on Wed Jan 4 22:07:38 2023
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:DOCKER_OUTPUT - [0:0]
:DOCKER_POSTROUTING - [0:0]
-A OUTPUT -d 127.0.0.11/32 -j DOCKER_OUTPUT
-A POSTROUTING -d 127.0.0.11/32 -j DOCKER_POSTROUTING
-A DOCKER_OUTPUT -d 127.0.0.11/32 -p tcp -j DNAT --to-destination 127.0.0.11:44029
-A DOCKER_OUTPUT -d 127.0.0.11/32 -p udp -j DNAT --to-destination 127.0.0.11:33690
-A DOCKER_POSTROUTING -s 127.0.0.11/32 -p tcp -j SNAT --to-source :53
-A DOCKER_POSTROUTING -s 127.0.0.11/32 -p udp -j SNAT --to-source :53
COMMIT (NOTE: this skips the entrypoint logic etc, the point is to debug purely what docker is doing on its own with the embedded DNS rules) |
Docker might have actually dropped the dport themselves at some point, given that they probably don't expect other traffic on I did a bit of digging and haven't turned up anything though, and in #15578 (comment) it appears that docker, containerd are identical but iptables versions are different. |
@mnk i was wrong - haven't read your initial problem statement carefully, so was jumping to a conclusion; sorry about that! i've looked at it a bit and i think that the problem is in using i suggest you try with iptables-legacy instead - here's what i did:
|
btw, i've also compared docker versions that are installed on a fresh ubuntu 20.04.5 (where iptables-legacy is default and this is working) and fedora 37 (where iptables-nft are default and apparently is not working), and they use identical versions/commits: ubuntu 20.04.5:
fedora37:
|
looks like there were some efforts to support automatic iptables "mode" detection, but it seems that it's not working correctly in this case and this comment from Tim Hockin is a bit old but perhaps still relevant |
looks like minikube user(s) reported identical problem earlier: #14631 (comment) whereas original problem refers to so, if this switch to iptables-legacy is a working solution for @mnk, perhaps we add detection in minikube so if we see iptables-nft, we warn the user that "things might not work as expected" |
That's not quite related. That change in Kubernetes is related to automatic mode detection in the kube-proxy image, in a "normal" environment by looking for rules setup by kubelet on the host. In our case we instead detect based on docker injecting rules for the embedded DNS resolver using the host iptables legacy or nf_tables. That tweet predates the detection logic entirely, which is itself a workaround for the problem of there not being a stable interface and distros switching between the two binaries / backends. The upstream KIND entrypoint has the same detection logic as kube-proxy (prior to the trick looking at kubelet generated rules specifically). My host really is using nf_tables 1.8.8 and I don't see And now that I've typed that, kubernetes/kubernetes#112477 is paging back into memory 🙃
1.8.4 is really old, so that's a different problem for minikube specifically. In both cases, 1.8.8 on the host is currently a problem. kube-proxy in Kubernetes 1.26 is also on 1.8.7 so updating to 1.8.8 in kind/minikube is probably not sufficient yet. Downgrading to 1.8.7 on the host is one workaround. Switching to legacy mode is another. Both work around the mismatched versions rather than legacy vs nf_tables detection. |
This is also just one incompatibility between 1.8.8 and 1.8.7, we're going to have more problems when we do upgrade kubernetes/kind/... to > 1.8.7 (see above issue with |
thanks for sharing the details @BenTheElder !
looks like the full transition from legacy to nft is going to be fun and not so quick |
Yes, as @BenTheElder mentions, this indeed seems to be another case of incompatibility between 1.8.8 and 1.8.7. Without involving minikube, the problem can bee seen by:
Both 1.8.8 and 1.8.7 does however produce similar output from
I guess that means that the docker rules are fine until minikube starts patching them with Would it be possible for minikube/kind to just remove the docker rules and then create the needed rules from scratch? |
This works fine (on my VM) 😄 kubernetes-sigs/kind#3059 |
So KIND doesn't use save+restore itself, but kube-proxy in Kubernetes works this way for good reasons (reconciling a large set of rules) and there's a third version of iptables in the kube-proxy image. I suspect the same for minikube. On your host with minikube it's 1.8.8 nf_tables, 1.8.4 ?, and then 1.8.7 ? (kube-proxy in 1.25). In KIND it will be 1.8.8 nf_tables (host), 1.8.7 nf_tables (node), 1.8.7 nf_tables (kube-proxy). There's actually a fourth for CNI ... but that's generally kube-proxy matching more or less. Discussing with @aojea and kubernetes-sigs/kind#3059 how we might work around this. One thought is multi-version selecting the binaries and attempting to detect what the host is using. Another is the workaround in kubernetes-sigs/kind#3059 combined with making sure at least kube-proxy + kindnetd + kind node match. Which is a trickier proposition for additional CNIs minikube may support. |
Closing the loop: that's completely backwards :-) kind does kube-proxy avoids |
kubernetes-sigs/kind#3054 tracks the KIND fix which wound up compromising on ~#15578 |
#14631 (comment) |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What Happened?
There seems to be a difference in minikube iptables rules when comparing a fully updated Fedora 36 and Fedora 37 system.
On Fedora 36:
On Fedora 37:
The missing
--dport 53
condition on the destination NAT breaks all non-DNS communication between host and minikube.What might be causing this difference?
Attach the log file
log.txt
Operating System
Redhat/Fedora
Driver
Docker
The text was updated successfully, but these errors were encountered: