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

cni: reduce memory usage #3047

Merged
merged 2 commits into from
Jul 18, 2023
Merged

cni: reduce memory usage #3047

merged 2 commits into from
Jul 18, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Jul 18, 2023

What type of this PR

  • Performance

Which issue(s) this PR fixes:

This patch reduces ~9MB memory usage on each CNI call.

WHAT

🤖 Generated by Copilot at 0cae295

Refactor the cni package to be a standalone binary for linux and windows platforms. Add support for building and packaging the kube-ovn CNI plugin for amd64 and arm64 architectures.

🤖 Generated by Copilot at 0cae295

Oh we're the crew of the kube-ovn ship
And we're sailing on the Kubernetes sea
We're refactoring the cni package
To make it a standalone binary

HOW

🤖 Generated by Copilot at 0cae295

  • Refactor the cni package to be a standalone binary instead of a subcommand of the kube-ovn binary (link, link, link, link, link, link, link, link)
  • Remove the import of the cni package and the constant CmdCNI from the cmdmain.go file (link, link)
  • Remove the case for the CmdCNI from the switch statement in the main function of the cmdmain.go file (link)
  • Change the package name of the cni.go, netconf.go, and netconf_windows.go files from cni to main (link, link, link)
  • Change the function name of the cni.go file from CmdMain to main (link)
  • Delete the file cmd/windows/cni/main_windows.go (link)
  • Add support for linux amd64 and arm64 platforms for the CNI plugin binary (link, link)
    • Add a new command to the Makefile to build the kube-ovn binary for linux amd64 platform and copy it to the dist/images directory (link)
    • Modify the command to build the kube-ovn binary for linux arm64 platform and copy it to the dist/images directory along with the other binaries (link)

@zhangzujian zhangzujian added the performance Anything that can make Kube-OVN faster label Jul 18, 2023
@zhangzujian zhangzujian linked an issue Jul 18, 2023 that may be closed by this pull request
@zhangzujian zhangzujian merged commit ed58b21 into kubeovn:master Jul 18, 2023
58 checks passed
@zhangzujian zhangzujian deleted the oom branch July 18, 2023 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Anything that can make Kube-OVN faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multi nic: multus call kube-ovn oom-killled
2 participants