Supporting user-defined kubelet directory #2893
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of this PR
Examples of user facing changes:
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, theconfig.go
andhandler.go
files in thepkg/daemon
package, and the corresponding Linux and Windows handlers. It also adds a new command-line flagkubelet-dir
for the daemon component.🤖 Generated by Copilot at 5817053
HOW
🤖 Generated by Copilot at 5817053
--kubelet-dir
to the ovn-cni daemonset container, which allows specifying the path of the kubelet directory (link)/var/lib/kubelet/pods
with the value of thekubelet-dir
flag in the ovn-cni daemonset container, which is passed as a Helm value (link)KubeletDir
to theConfiguration
struct inpkg/daemon/config.go
, which stores the value of thekubelet-dir
flag (link)kubelet-dir
flag from the command-line arguments and set the default value to/var/lib/kubelet
in theParseFlags
function inpkg/daemon/config.go
(link, link)KubeletDir
field of theConfiguration
struct to construct the origin and new shared directories for the vhostuser socket volume in thecreateShortSharedDir
function inpkg/daemon/handler_linux.go
(link, link)createShortSharedDir
function inpkg/daemon/handler_linux.go
(link, link)time
package to the imports of thepkg/daemon/handler_linux.go
file, which is needed for the loops (link)KubeletDir
field of theConfiguration
struct to the arguments of thecreateShortSharedDir
function in thehandleAdd
function inpkg/daemon/handler.go
, which is responsible for creating a short symbolic link for the vhostuser socket volume of the pod (link)kubeletDir
parameter to the signature of thecreateShortSharedDir
function inpkg/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)