Skip to content

Conversation

@longxiucai
Copy link
Contributor

Enables the parameterization of the kubelet mount path during node-agent installation

This PR enables the parameterization of the kubelet mount path during node-agent installation, allowing users to specify custom mount paths through configuration parameters. This addresses scenarios where different Kubernetes environments may use non-standard kubelet directories.

  • This change introduces a new configuration parameter --kubelet-root-dir during node-agent installation.
  • The default value remains unchanged to maintain backward compatibility.

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

sseago
sseago previously approved these changes Jul 8, 2025
@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 60.05%. Comparing base (232bc90) to head (ab76f96).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/cli/install/install.go 0.00% 4 Missing ⚠️
pkg/install/resources.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9074      +/-   ##
==========================================
- Coverage   60.06%   60.05%   -0.01%     
==========================================
  Files         379      379              
  Lines       43483    43496      +13     
==========================================
+ Hits        26116    26122       +6     
- Misses      15801    15807       +6     
- Partials     1566     1567       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

kaovilai
kaovilai previously approved these changes Jul 8, 2025
Copy link
Collaborator

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to update docs/ to explain this.. but lgtm.

@longxiucai longxiucai dismissed stale reviews from kaovilai and sseago via 26b4fef July 10, 2025 01:11
@longxiucai
Copy link
Contributor Author

You may want to update docs/ to explain this.. but lgtm.

I've made the requested documentation updates and pushed a new commit with these changes to this PR.

kaovilai
kaovilai previously approved these changes Jul 10, 2025
@Lyndon-Li Lyndon-Li self-requested a review July 11, 2025 05:45
@Lyndon-Li Lyndon-Li added downstream-integration The issue originated from downstream integration carvel-package-impacted and removed downstream-integration The issue originated from downstream integration labels Jul 11, 2025
@blackpiglet blackpiglet force-pushed the nodeagent-kubelet-root-dir branch from a2a1a9b to 182d72f Compare July 16, 2025 09:27
@longxiucai longxiucai closed this Jul 17, 2025
@longxiucai longxiucai force-pushed the nodeagent-kubelet-root-dir branch from 182d72f to 805237a Compare July 17, 2025 05:15
@github-actions github-actions bot requested a review from sseago July 17, 2025 05:25
@github-actions github-actions bot added the Dependencies Pull requests that update a dependency file label Jul 17, 2025
kaovilai
kaovilai previously approved these changes Jul 17, 2025
go.mod Outdated
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the new dependencies are not related to the current change, please double check and add the necessary changes only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/git/velero nodeagent-kubelet-root-dir
❯ go mod why github.com/Microsoft/go-winio
# github.com/Microsoft/go-winio
github.com/vmware-tanzu/velero/pkg/install
k8s.io/kubernetes/pkg/kubelet/config
k8s.io/kubernetes/pkg/kubelet/types
k8s.io/cri-client/pkg/logs
k8s.io/cri-client/pkg
k8s.io/cri-client/pkg/util
github.com/Microsoft/go-winio

Came in via c49517b which imports k8s.io/kubernetes/pkg/kubelet/config to replace redeifning

-	hostPodsVolumePath := filepath.Join(c.kubeletRootDir, "pods")
-	hostPluginsVolumePath := filepath.Join(c.kubeletRootDir, "plugins")
+	hostPodsVolumePath := filepath.Join(c.kubeletRootDir, kubeletconfig.DefaultKubeletPodsDirName)
+	hostPluginsVolumePath := filepath.Join(c.kubeletRootDir, kubeletconfig.DefaultKubeletPluginsDirName)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which IIUC is @blackpiglet request

There appears to be no alternative k8s.io package that provides the same symbol. https://pkg.go.dev/search?q=DefaultKubeletPodsDirName&ref=opensearch

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are not okay with the added imports, we might have to settle with the prior change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is because kubelet is platform dependent.
My opinion is we always keep the code platform independent unless really necessary, so in comparison, copying the default rootDir strings to Velero is acceptable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe revert to ths commit then 2d1a8bc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I've reverted commit c49517b while keeping 2d1a8bc

@longxiucai longxiucai force-pushed the nodeagent-kubelet-root-dir branch from 79259f9 to 2d1a8bc Compare July 23, 2025 01:36
@blackpiglet blackpiglet merged commit 8ce513c into vmware-tanzu:main Jul 23, 2025
45 of 46 checks passed
@MaloLelandais MaloLelandais mentioned this pull request Jul 28, 2025
3 tasks
MaloLelandais pushed a commit to MaloLelandais/velero that referenced this pull request Jul 28, 2025
vmware-tanzu#9074)

Enable parameterized kubelet mount path during node-agent installation

Signed-off-by: longyuxiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants