-
Notifications
You must be signed in to change notification settings - Fork 716
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
nodes with multiple network interfaces can fail to talk to services #102
Comments
@damaspi I have opened this issue and provided a fix. Waiting on feedback! Also, moving to |
Sorry, I commented in the wrong issue. |
I copied it here now, and delete it in the other... I worked-around temporarily by configuring proxy-mode to userspace but any advice welcome... (inspired by this issue )
|
Again, @damaspi
|
I had the same issue. My fix was to modify the Kubeadm DaemonSet for kube-proxy and add explicitely the --cluster-cidr = option. |
/cc @luxas |
@spxtr you are closing a bunch of issues in this repo |
@mikedanese PRs being merged and there was a PR merged that fixed the lack of |
Ah I've seen it before indeed. |
I have seen this on 1.5.2. I manually building a cluster (to learn.) . I am unclear what the fix is, as there is mention of controller-manager and daemon set. That implies to me that people are launching kube-proxy via a daemon-set. Just to clarify, the actual fix is to add the flag (--cluster-cidr) to kube-proxy correct? Just trying to make sure I am not missing something. Also, just to clear my memory, didn't kube-proxy use to get this from the kube-apiserver? Was it always needed, I can't remember. If it doesn't, can someone clarify the difference between --service-cluster-ip-range=10.0.0.0/16 (api) and --cluster-cidr (proxy)? Thanks. (sorry to add here, not sure where else to ask for this issue.) |
Where did the API server exposed the cluster pod CIDR? This was a misconception on my side as well. |
Hi @pires, I thought . --service-cluster-ip-range=10.0.0.0/16 on the api-server set it all up as the proxies would talk to the k8s server to get that information. --cluster-cidr maybe was to do a subset of --service-cluster-ip-range, else it seems redundant or there is a use case that I am unclear about (or I just don't know what I am talking about, which could be true!) |
Service CIDR is the subnet used for virtual IPs (used by kube-proxy). Problem is kube-proxy doesn't know about pod network CIDR, which is different than service CIDR. |
Ah, so would that be the overlay? |
Would this issue cause communication between pod and api-server? For example if I was to run the curl command from a kube pod to apiserver "curl https://10.96.0.1:443/api" result:> curl: (7) Failed to connect to 10.96.0.1 port 443: Connection timed out... |
I just had a look at the clusterCIDR logic in kube-proxy, and I agree that is a weird corner case. I agree the static route is appropriate for the 2nd interface, but it's unfortunate. It feels like the kernel should be smarter than that. |
I'm running v1.6.1 and thought the error "clusterCIDR not specified, unable to distinguish between internal and external traffic" would be address. 2017-06-06T17:49:17.113224501Z I0606 17:49:17.112870 1 server.go:225] Using iptables Proxier. |
how to define the internal and external traffic ? |
This error specifically refers to anything outside the clusters Pod IPs.
…On Thu, Jun 8, 2017 at 10:29 PM, timchenxiaoyu ***@***.***> wrote:
how to define the internal and external traffic ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#102 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVPwm-x4smcIx1cFAOLOO6FFIn9T6ks5sCNgkgaJpZM4La21F>
.
|
I've seen this problem too. a route to the pod network to the second nic resolved the issue for me. Feels a little fragile though..... |
…erstand what's internal and external traffic. Fixes kubernetes/kubeadm#102
Hi, I'm running Kubernetes v1.6.6 & v1.7.0 kube-proxy. Getting the same error, kube-proxy:
Kubernetes version:
Try the workaround from @damaspi but failed in v1.6.6 and v1.7.0 use to work in v1.5.4.
Need guidance to resolve in v1.6.6 & v1.7.0. Thanks. |
I don't think kubeadm should be spitting out OS or distro-specific configuration instructions for host networking. I think it's the responsibility of the operator to configure their host appropriately because otherwise it becomes a rabbit hole. We can certainly make it a requirement, though. What should kubeadm expect for things to work? That if the user wants to use a non-default NIC, they need to add a static route in Linux? Is this a general enough use-case for us to add it as a system requirement? |
@bboreham Any ideas on how we can improve our documentation here? Otherwise I'm in favour of closing this because:
|
[Aside: it bugs me I have to read up and down and through other issues to page the context back in. The problem people wanted resolved is absolutely nothing to do with the title of this issue] In the setup docs you could say "if you have more than one network adapter, and your Kubernetes components are not reachable on the default route, we recommend you add IP route(s) so Kubernetes cluster addresses go via the appropriate adapter". |
You are not the only one! 😅
Cool, I'll try to submit a docs PR for this tomorrow and close this out. |
This is now documented in kubernetes/website#6265, so I'm going to close. This issue seems to track a few different problems at once, so if you're still running into a potential bug, please open a new issue so can better target the root cause. |
FWIW, if you use kubeadm to start the cluster, if you specify the "pod-network-cidr", that'll get passed to the kube-proxy when it starts as the "cluster-cidr". For example, weave defaults to using "10.32.0.0/12"...so I used |
@bboreham I'm new to this...Would there be an example on how to implement your suggestion "add IP route(s) so Kubernetes cluster addresses go via the appropriate adapter"? |
@bamb00 scroll up; there is an example at #102 (comment) Caution: if you make a wrong step it may will result in your machine being inaccessible. Generally this will come back after a reboot, unless you configured the bad route to be there on startup. I do not know an easy way to learn Linux network configuration. |
@mindscratch do note this issue has nothing to do with "cluster-cidr"; that was a red herring eliminated around seven months ago. Please open a new issue if you are having new problems. |
Semi-serious suggestion for fixing this specific case without requiring the
(or possibly some variation with an explicit
However, I have no idea if that covers all of the expected behaviors of those source-specific kube-proxy MASQ rules... EDIT: this also has all kinds of side-effects for connections to unconfigured service VIPs... they will end up connecting to any matching host network namespace services. EDIT2: However, even that is probably better than the current behavior of leaking connections to unconfigured 10.96.X.Y service VIPs out via the default route... which is vaguely unsettling |
UPDATE as of Feb 7th, 2018 by request of @bboreham I've edited the title so to not mislead people looking for unrelated issue.
As reported by @damaspi:
The text was updated successfully, but these errors were encountered: