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

Supporting user-defined kubelet directory #2893

Merged
merged 1 commit into from
Jun 5, 2023
Merged

Supporting user-defined kubelet directory #2893

merged 1 commit into from
Jun 5, 2023

Conversation

lynn901
Copy link
Member

@lynn901 lynn901 commented Jun 2, 2023

What type of this PR

Examples of user facing changes:

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #2047

WHAT

🤖 Generated by Copilot at 5817053

This pull request adds a new feature to customize the kubelet directory for the ovn-cni daemonset, which is useful for DPDK-based network interfaces. It modifies the ovncni-ds.yaml chart template, the config.go and handler.go files in the pkg/daemon package, and the corresponding Linux and Windows handlers. It also adds a new command-line flag kubelet-dir for the daemon component.

🤖 Generated by Copilot at 5817053

Sing, O Muse, of the cunning ovn-cni daemonset
That brought to many pods a swift and smooth network
By creating short links for the vhostuser sockets
With createShortSharedDir, a skillful function.

HOW

🤖 Generated by Copilot at 5817053

  • Add a new flag --kubelet-dir to the ovn-cni daemonset container, which allows specifying the path of the kubelet directory (link)
  • Replace the hard-coded path /var/lib/kubelet/pods with the value of the kubelet-dir flag in the ovn-cni daemonset container, which is passed as a Helm value (link)
  • Add a new field KubeletDir to the Configuration struct in pkg/daemon/config.go, which stores the value of the kubelet-dir flag (link)
  • Parse the kubelet-dir flag from the command-line arguments and set the default value to /var/lib/kubelet in the ParseFlags function in pkg/daemon/config.go (link, link)
  • Use the KubeletDir field of the Configuration struct to construct the origin and new shared directories for the vhostuser socket volume in the createShortSharedDir function in pkg/daemon/handler_linux.go (link, link)
  • Add loops to check if the origin and new shared directories exist, and wait for up to 20 seconds if not, in the createShortSharedDir function in pkg/daemon/handler_linux.go (link, link)
  • Add the time package to the imports of the pkg/daemon/handler_linux.go file, which is needed for the loops (link)
  • Add the KubeletDir field of the Configuration struct to the arguments of the createShortSharedDir function in the handleAdd function in pkg/daemon/handler.go, which is responsible for creating a short symbolic link for the vhostuser socket volume of the pod (link)
  • Add the kubeletDir parameter to the signature of the createShortSharedDir function in pkg/daemon/handler_windows.go, which is a dummy function that does nothing on Windows, to keep the function signature consistent with the Linux version (link)

pkg/daemon/handler_linux.go Fixed Show fixed Hide fixed
pkg/daemon/handler_linux.go Fixed Show fixed Hide fixed
@zbb88888 zbb88888 requested a review from hongzhen-ma June 2, 2023 08:13
@zbb88888
Copy link
Collaborator

zbb88888 commented Jun 2, 2023

I'm not sure about the yaml, please help check @hongzhen-ma

@zbb88888 zbb88888 merged commit 35aa8b4 into kubeovn:master Jun 5, 2023
zbb88888 pushed a commit that referenced this pull request Nov 14, 2023
Co-authored-by: yuanliu <yuanliu@cmss.chinamobile.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for specifying kubelet directory
3 participants