-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Remove the ethtool kubelet dependency; use ip link instead of ethtool to determine pair interface. #30356
Conversation
Assigned to @matchstick to review or delegate. |
@@ -37,7 +37,7 @@ const ( | |||
) | |||
|
|||
var ( | |||
ethtoolOutputRegex = regexp.MustCompile("peer_ifindex: (\\d+)") | |||
ipLinkOutputRegex = regexp.MustCompile("eth0@if(\\d+)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does this come from? "eth0" is not a given...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now eth0 is hardcoded in an other file with a todo to make it configurable. I may fetch the value from there instead.
Do you still think it may be something other than eth0 (on kubenet for example, which I haven't tested much)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubenet is not depending on the kubelet hairpin logic now. The CNI bridge plugin does the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete any of the old (pre-kubenet) code now before 1.4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thockin I think we should keep it in v1.4, but after the release we might remove it if it's unneeded.
Since kubenet is on by default now. I do not think the auto e2e test will cover the code changes here. I would recommend setting the |
… to determine pair interface.
Okay. LGTM. Please revert the test commit and self apply LGTM label. |
Thanks for the review! |
@k8s-bot smoke test this please github issue: #IGNORE |
@k8s-bot test this please github issue: #IGNORE |
GCE e2e build/test passed for commit ae97cda. |
hmmm. I just came across a counter case.
It looks like we still cannot get rid of |
Ah, how bad! How did you produce that behaviour? |
Can we just do the things that ethtool is doing under the covers? I know On Thu, Aug 18, 2016 at 2:12 PM, Lucas Käldström notifications@github.com
|
https://raw.githubusercontent.com/safchain/ethtool/master/ethtool.go I just ran this, it works. On Thu, Aug 18, 2016 at 4:16 PM, Tim Hockin thockin@google.com wrote:
|
@thockin That's a good idea, but we can't. Guess we have to fallback on ethtool |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Hah @thockin this was the one I was talking about :) |
We actually might want to consider this for v1.5 as a bug fix given kubernetes/kops#879 |
Do we really understand the escape that @freehan showed? What makes us think we really understand it? Are we sure all versions of kernels and Is this My fear is we are replacing something known to work (but a dependency) with something new and undocumented. It looks like a side-effect, not an API. I want to know it is reliable. |
I agree that relying on the output format of
A trick used in various places (e.g. Docker) is to re-exec the current executable with arguments to do just the one task we need done in a different namespace. |
Can not we use there directly It should be really easy to replicate what @thockin |
@jellonek it is necessary to look in the pod's network namespace, so If you add Edit: One more thing: the CNI page qualifies its recommendation with "All code dependent on a particular network namespace should be wrapped in the |
@jellonek please read up the issues I have linked. Your approach (which I also once thought was safe) has caused many weird failures in Docker, Weave Net and other places. It is not possible with the current Go runtime to have one goroutine change namespace without sometimes affecting other goroutines. You must use a separate process to change namespace. |
@bboreham ack. will definitely read both of mentioned issues. |
Ok. So with current version of golang runtime we can not use such approach. I'll close my PR. |
Closing this as I don't have time to look into it. Can maybe be revisited in the future |
@kubernetes/sig-network does this seem worthwhile?
I noticed that the
ip link
inside a container is namedeth0@if{host_pair_interface}
. This PR removes the dependency on ethtool that does that lookup as well.Can you reproduce and verify?
ref #26093
This change is