Use hard-coded kubelet path for s3-plugin container#656
Merged
Conversation
muddyfish
reviewed
Jan 14, 2026
muddyfish
reviewed
Jan 14, 2026
muddyfish
reviewed
Jan 15, 2026
muddyfish
reviewed
Jan 16, 2026
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
muddyfish
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
*Issue #577 *
Description
On MicroK8s (snap install), kubelet uses
/var/snap/microk8s/common/var/lib/kubeletas its root directory. In CSI Driver v2, Unix socket paths built from this base exceed Linux's 108-byteUNIX_PATH_MAXlimit, causing bind() / connect() to fail with invalid argument. The driver either fails to register with kubelet or fails to communicate with Mountpoint pods, making S3 mounts impossible. This affects any Kubernetes distribution with a long kubelet path.Fix
Hard-code the container-side mountPath to
/var/lib/kubeletregardless of the host path. The host path remainsconfigurable via
node.kubeletPath(used as the volume source), but inside the container all paths are short.Replace the single
KUBELET_PATHenv var with:CONTAINER_KUBELET_PATH=/var/lib/kubelet— path as seen inside the containerHOST_KUBELET_PATH— path as seen on the host (from node.kubeletPath)Add
KubeletHostPathToContainerPath()to translate host paths (received from kubelet RPCs) to container paths in bothNodePublishVolumeandNodeUnpublishVolume.Verification
Tested on Ubuntu 22.04 with MicroK8s (snap, channel 1.32) and node.kubeletPath=/var/snap/microk8s/common/var/lib/kubelet.
Without the fix, the driver fails to register as reported in Issue #577 — the registration socket path exceeds Linux's 108-byte limit.
With the fix — driver registers successfully and all 3 node containers are running:
S3 mount works — workload pod writes to the bucket:
Testing
Manual Testing with E2E tests passing: (rosa was not set up in my CI)
https://github.com/tadiwa-aizen/mountpoint-s3-csi-driver/actions/runs/23405969976
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.