S3CSI-213: Fix mounter pod FSGroup for workload pods with fsGroup#328
Draft
anurag4DSB wants to merge 8 commits intomainfrom
Draft
S3CSI-213: Fix mounter pod FSGroup for workload pods with fsGroup#328anurag4DSB wants to merge 8 commits intomainfrom
anurag4DSB wants to merge 8 commits intomainfrom
Conversation
Set FSGroup in the mounter pod's PodSecurityContext to the MountpointPodUserID (1000 on vanilla K8s). Without this, the emptyDir communication directory (/comm/) does not get the correct group ownership, causing the non-root mount-s3 process to fail reading/writing the unix socket when the workload pod specifies its own fsGroup. Issue: S3CSI-213
Add a new mounterpod test suite with two tests: 1. Verifies the mounter pod's PodSecurityContext.FSGroup, RunAsUser, and RunAsNonRoot are set correctly. 2. Reproduces the customer scenario where a workload pod with fsGroup set in its SecurityContext failed to mount S3 volumes, and verifies that the mount succeeds and data can be read/written. Issue: S3CSI-213
Update code version and documentation references from 2.1.0 to 2.1.1. Add release notes for v2.1.1. Issue: S3CSI-213
4 tasks
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Add two E2E tests to the mounter pod suite: - Dynamic provisioning with fsGroup on workload pod - Separate mounter pods for different fsGroup values on shared volume Add a reference page explaining how Kubernetes fsGroup interacts with the CSI driver's pod mounter architecture, including static and dynamic provisioning examples and the relationship between fsGroup and mount options (uid/gid).
a60b7ab to
82d52ee
Compare
The reconciler reads fsGroup from pod.Spec.SecurityContext.FSGroup to build S3PA field filters, but the node driver reads from VolumeMountGroup in the CSI request. For RWX volumes with the default fsGroupPolicy (ReadWriteOnceWithFSType), kubelet does not populate VolumeMountGroup, causing an S3PA lookup mismatch and mount timeout. Fix: when VolumeMountGroup is empty, the pod mounter resolves fsGroup directly from the workload pod's SecurityContext via the k8s API — the same authoritative source the reconciler uses. This also applies the matching mount options (--gid, --allow-other, --dir-mode, --file-mode) for proper file access. Issue: S3CSI-213
Pod-level fsGroup always takes precedence over --gid in PV/SC mount options. This ensures the workload pod's security intent is honored when both are set. Issue: S3CSI-213
Add three new E2E tests covering fsGroup mount option behaviors: - Dynamic provisioning volume sharing with different fsGroup values - FSGroup auto-applies --gid, --dir-mode, --file-mode when absent - FSGroup overrides --gid from PV mount options Update docs with automatic mount option resolution details and simplified configuration examples.
Set format.MaxLength to 0 so test failures print full error details instead of truncated representations.
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.
Summary
fsGroupin theirsecurityContext. The mounter pod's communication socket (/comm/mount.sock) timed out because the emptyDir volume lacked proper group ownership. The fix addsFSGroupto the mounter pod'sPodSecurityContext.Test plan
make unit-test)make lint)go build ./...intests/e2e/)