Skip to content
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

cilium CNI cannot be used in combination with bandwidth CNI #24899

Closed
2 tasks done
nayihz opened this issue Apr 14, 2023 · 2 comments · Fixed by #26518
Closed
2 tasks done

cilium CNI cannot be used in combination with bandwidth CNI #24899

nayihz opened this issue Apr 14, 2023 · 2 comments · Fixed by #26518
Labels
kind/bug This is a bug in the Cilium logic. kind/community-report This was reported by a user in the Cilium community, eg via Slack. needs/triage This issue requires triaging to establish severity and next steps.

Comments

@nayihz
Copy link
Contributor

nayihz commented Apr 14, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

In my testing environment, I tested the scenario of using cilium and bandwidth CNI together(we cannot use cilium bandwidthManager because our os kernel version is too low to meet the requirements.). Then we found that an error occured when bandwith CNI was called: no veth peer of container interface found in host ns.

After reivewing the bandwith CNI source code, the reason for this error is that the result returned by cilium CNI does not meet the following containtion.
https://github.com/containernetworking/plugins/blob/4a6147a1552064af80b4f7567b30c5174153c62a/plugins/meta/bandwidth/main.go#L153-L160

for _, iface := range interfaces {
    if iface.Sandbox == "" && iface.Name == link.Attrs().Name {
	return iface, nil
    }
}

The official documentation of CNI requires that the interfaces field should include information about both container-side interface and host-side interface. However, currently cilium only provides the container-side interface information.

https://www.cni.dev/docs/spec/#section-5-result-types

  • interfaces: An array of all interfaces created by the attachment, including any host-level interfaces:
    • name: The name of the interface.
    • mac: The hardware address of the interface (if applicable).
    • sandbox: The isolation domain reference (e.g. path to network namespace) for the interface, or empty if on the host. For interfaces created inside the container, this should be the value passed via CNI_NETNS.

some test code:

+       log.Println("interfaces length:", len(interfaces))
        for _, iface := range interfaces {
+               log.Println("iface name:", iface.Name)
+               log.Println("sandbox: ", iface.Sandbox)
+               log.Println("link.Attrs().Name: ", link.Attrs().Name)
                if iface.Sandbox == "" && iface.Name == link.Attrs().Name {
                        return iface, nil
                }
        }

output:

2023/04/13 07:20:51 interfaces length: 1
2023/04/13 07:20:51 iface name: eth0
2023/04/13 07:20:51 sandbox:  /var/run/netns/cni-882cb34f-9dd9-6014-556b-724e5d2e383d
2023/04/13 07:20:51 link.Attrs().Name:  lxc1986c9428372

Cilium Version

1.13.0

Kernel Version

5.15.0-69-generic

Kubernetes Version

Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.3", GitCommit:"9e644106593f3f4aa98f8a84b23db5fa378900bd", GitTreeState:"clean", BuildDate:"2023-03-15T13:40:17Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.3", GitCommit:"9e644106593f3f4aa98f8a84b23db5fa378900bd", GitTreeState:"clean", BuildDate:"2023-03-15T13:33:12Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}

Sysdump

No response

Relevant log output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nayihz nayihz added kind/bug This is a bug in the Cilium logic. kind/community-report This was reported by a user in the Cilium community, eg via Slack. needs/triage This issue requires triaging to establish severity and next steps. labels Apr 14, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Jun 14, 2023
@github-actions
Copy link

This issue has not seen any activity since it was marked stale.
Closing.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2023
@tklauser tklauser reopened this Jun 28, 2023
@github-actions github-actions bot removed the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic. kind/community-report This was reported by a user in the Cilium community, eg via Slack. needs/triage This issue requires triaging to establish severity and next steps.
Projects
None yet
2 participants