-
Notifications
You must be signed in to change notification settings - Fork 591
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
Merge Results from delegates #165
Conversation
Currently Master Plugin result is returned by Multus. This patch merges the results from all delegates as per the CNI spec. This fixes issues of Multus and Virtlet. Signed-off-by: Ritu Sood <[email protected]>
Pull Request Test Coverage Report for Build 610
💛 - Coveralls |
@ritusood Could you please fix the multus_test.go as well. Unit test is failing in this. can you execute |
@rkamudhan @ritusood , I'm not clear that the multus output with the PR. Could you please show me some example output (with PR, but both are nice)? |
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.
Fix the ./test.sh
After the PR is applied sample Result in case of two interfaces: |
@ritusood could you also paste in your multus.conf that shows which delegates get called to produce the merged output above? |
The PR is moved to backlog and will be revisited later, when PR owners is back. |
It looks like this PR will combine the results from all of the delegates, both from the Multus config file and from the Kubernetes Network Attachments. I don't think that's what we want to do, because all of these are additional "sidecar" networks that should not be reported to Kubernetes. I could be wrong, but it looks like that's what would happen with this PR. @ritusood can you describe in more detail the issue that virtlet has with Multus that prompted this PR? Thanks! |
Request you to merge this code changes as early as possible. This code change will solve our issue... |
@dcbw This patch is needed for integrating Multus with Virtlet. Virtlet uses information returned from CNI plugin in form of https://github.com/containernetworking/cni/blob/master/SPEC.md#result and plugin result should contain a list of interfaces with data like ip addresses and routes. |
@kannanvr Multus is already capable of creating multiple network interfaces per pod using individual delegates. I still don't understand the specific issue that you have, so it's not possible to merge the code until we figure out whether it's appropriate behavior for Multus.
@ritusood I still don't see an explanation of why the PR combines the results from all delegates; if you could explain the reasoning behind that, and why it's required, then we can discuss my concerns about that behavior. Let's continue the discussion and see if we can reach and understanding on the behavior changes. Thanks! |
@dcbw As I understand since CNI Spec 0.3.0 there is a mechanism to provide multiple interfaces and IP addresses in Result structure. https://github.com/containernetworking/cni/blob/master/SPEC.md#result. |
@dcbw the thing is that at the moment runtime calling multus through cni is receiving cni result from only single plugin (called "main"), while we (Virtlet) are expecting a description what was set up during whole ADD call. This PR is about to provide "merged" information in similar way how CNI Genie is already doing that. At the moment simply Virtlet relies on full information what was done during ADD and providing an info only from one of plugins is simply misleading and not enough for us. @ritusood btw. it's not "kubernetes" which is ignoring other than first interface, but a particular shim. In your case it is probably docker shim which afair ignores cni result at all, trying to get info about networking directly from configured namespace, instead of relying on info returned by cni plugin (what is kinda breaking of abstraction provided by CNI API). I don't recall how it's done in containerd or other CRI runtimes (e.g. CRI-O) but they probably are replicating the way chosen by dockershim developers. |
Signed-off-by: Ritu Sood <[email protected]>
@ritusood @dcbw : Here is how, I tested the merge result PR. Copy the Rebased Ritu's PR Multus binary in the
then as we do in CNI community, we test the CNI as follows:
|
Found some interesting investigation from the testing current package:
No issues, with CNI version it is only 0.2.0 With the PRs, the result is as follows:
As the current package support 0.4.0. This having isses in the test, as we expect result to 020 type. #L230 #L322 #L401 Major problem is in-build code for Version() |
@rkamudhan will create a PR for the unit testing
So what is that existing functionality that doesn't expect this merging? It looks like it's expecting an output of only single cni plugin which in fact will be incorrect looking from perspective of CNI SPEC (output in Result should contain info about whole configured networking in container namespace). I still don't understand why you are calling that as a technical debt, while this clearly is removing a... technical debt against the SPEC. So I'm asking once again - is this colliding with kubevirt or anything else (openshift?) what is already using multus? |
The largest issue is that Kubernetes assumes that the ADD call results in one network attachment, while this PR will return a result that is the combination of multiple network attachments, only one of which is the cluster-wide default network that Kubernetes normally attached. The NPWG specification explicitly attempts not to change Kubernetes default behavior, and while at the moment this is not technically changing behavior under Kube (because kubelet doesn't use the Result yet), it's certainly changing the semantics in a way that is not future-proof. Kubernetes will soon get multiple IP address support but it is mainly for v4/v6 dual-stack and it will assume that IPs from the Result structure (once something like kubernetes/kubernetes#71653 lands) are from the same network attachment. When that happens, the combined Result from this PR will produce incorrect Kube results as the IPs in the combined Result are from multiple network attachments which are not guaranteed to be on the same data plane, which Kube requires. If you really want a fully combined result, then I'd suggest either the config option Doug mentions, or proposing a change to Multus that stuffs the combined result into a vendor-namespaced key in the Result structure that Kubernetes will ignore. That way you keep compatibility with various specifications and don't confuse a near-future kubelet. Or something like that. |
@ritusood Moving forward, the suggestion is to introduce config option in multus, that could combine the results or it could be flag for the multus build that combine the result. I will sync up internally, to explain the options with you.. |
@dcbw the thing is that multus is from the start a cni plugin multiplexer, so it's directly designed to attach on ADD container to multiple networks. btw. Kubernetes have not clue about CNI and it's not calling the ADD - this is responsibility of runtime behind CRI. Kubernetes does not care actually about result at all. The whole misunderstanding lays in the lack of distinction between kubelet and dockershim (one of CRI implementations). It's based on the fact that dockershim is not yet extracted from kubelet sources, but in fact it is started as a separate, independent process. So from "kubernetes" perspective there is no such thing like CNI - kubelet is calling a runtime which does the job using or ignoring CNI result. kubelet only expects an ip address in the result of Also please remember that Kubernetes (even if it's the biggest user of CNI) is not the direct target of CNI, so crippling a plugin (this one as example) to match a behavior expected by only single implementation of Kubernetes CRI (dockershim in this example) instead of making it fulfilling the CNI Specification - seems to be odd for me, especially when it comes from CNI maintainer... Other thing is this assumption that multiple attachments should be guaranteed to be on the same data plane - why anyone would want such limitation? It's contradiction to how actual kubernetes users are using multiple networks, where only one is used to connect to kubernetes services - the one which is using the ip address known by kubelet (I'll repeat - kubelet, not dockershim). Once again - please look on this from Specification perspective, which is NOT the expected by dockershim behavior perspective. |
@jellonek I'm aware of the history surrounding dockershim and Kubernetes. I'm also quite aware that other runtimes exist and I contribute to CRIO-O and dockershim upstream. I'm also quite aware that the NPWG specification that Multus is implementing is specifically targeted at Kubernetes, which despite the CRI situation is still not aware of multiple IP addresses or data planes. Kubernetes itself is still the driver, regardless of what the CRI itself does. And it does not expect separate data planes.
Nothing is being crippled. Two options were suggested that provides the functionality you desire.
Nobody is expecting the networks attached by Multus to be on the same data plane. But if you combine all the networks into the same Result then Kubernetes will think the IPs are on the same data plane if that Result is passed back to Kubernetes, which is a common thing to do. While dockershim doesn't look at the Result right now, that is going to happen very soon and combinations will break that.
This issue is not about CNI. This issue is about the Multus implementation of the NPWG specification which is inherently Kubernetes specific. And again, two solutions were proposed (a config option, or an additional combined result in the Result JSON dict that Virtlet would understand. I honestly don't know why we're still discussing this. What is the problem with one of those two options? |
We are discussing that because even if PR is already accepted by @rkamudhan and ready to be merged it should be updated to confirm to one of these two options or at least should have a followup in this direction. Btw. that could be also interesting for @kshafiee (probably also to @satyaranjanp and @sushanthakumar) to keep same approach also in CNI-Genie. But i see there also the same again and again confusing of what's on what level. You still are repeating that kubernetes has something to do with cni result. In fact - it's not on kubernetes (kubelet, or kubernetes objects like pods) side, but on CRI side. Even if in future kubernetes will gain the knowledge about multiple addresses - this information does not need to be generated from CNI result at all. It's up to CRI what it will return "to kubernetes". CRI can just return addresses accessible to data plane, but once again - it's not on CNI side to decide about that, it's all about how CRI will interpret the result and what it will return "to kubernetes". Repeating that there is an issue only because Virtlet expects something, while "kubernetes" expects something other is only becoming more and more annoying. |
[Requesting Merge] Can we please get this merged in? There's a pile of people waiting on this. Thanks... |
…sion tagged images to daemonsets
adding new imported package dependencies in vendor which is required for Kubelet Pod Resource api client. Change-Id: If6c74598e12af5f8659df69371e72dd064823f49
This change introduces kubelet client to get allocated device information of a Pod from newly added Kubelet grpc service. For more information please see: [kubernetes/kubernetes#70508](kubernetes/kubernetes#70508) Change-Id: I11e58ccdd52662601f445fa24c7d55c225441efc Signed-off-by: Abdul Halim <[email protected]>
This patch fixes the issue described in k8snetworkplumbingwg#289 where deviceID for delegate plugin was not adding properly if the plugin conf inside NetConfList. Change-Id: I1d221f6b0e60a5b888b8e823611dfe12635e6897 Signed-off-by: Abdul Halim <[email protected]>
Currently Master Plugin result is returned by Multus. This patch merges the results from all delegates as per the CNI spec. This fixes issues of Multus and Virtlet. Signed-off-by: Ritu Sood <[email protected]>
Signed-off-by: Ritu Sood <[email protected]>
Signed-off-by: Ritu Sood <[email protected]>
This PR will be merge on the top v3.2 and will be released as a separate version. |
With RollingUpdate update strategy, after you update a DaemonSet template, old DaemonSet pods will be killed, and new DaemonSet pods will be created automatically, in a controlled fashion.
…sion tagged images to daemonsets
Merge and rebase the pr
I use multus-v3.3-tp with intel/sriov-cni to add vf into a vm build by virtlet, Is there lack of something else? |
Looking the error message, it is not related to multus but seems to be virtlet issue. |
Currently only Master Plugin result is returned by Multus.
This patch merges the results from all delegates as
per the CNI spec. This fixes Multus and Virtlet compatibility
issue.
Signed-off-by: Ritu Sood [email protected]