feat: support VOLUME_MOUNT_GROUP for non-root pod volume access#9
Open
sheyabernstein wants to merge 2 commits intomainfrom
Open
feat: support VOLUME_MOUNT_GROUP for non-root pod volume access#9sheyabernstein wants to merge 2 commits intomainfrom
sheyabernstein wants to merge 2 commits intomainfrom
Conversation
mkfs.ext4 creates the filesystem root as root:root 0755, blocking writes from non-root pods. Instead of a blanket chmod 0777, implement proper CSI VOLUME_MOUNT_GROUP support so kubelet passes the pod's fsGroup to the driver. - Advertise VOLUME_MOUNT_GROUP node capability - Set fsGroupPolicy to File so kubelet delegates to the driver - Apply chown/chmod 0775 in both NodeStageVolume and NodePublishVolume using the volume_mount_group from the request - NodePublishVolume handles it too so volumes staged before the upgrade also get correct permissions without needing PVC recreation
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.
Overview
mkfs.ext4 creates the filesystem root as root:root 0755, blocking writes from non-root pods. Instead of a blanket chmod 0777, implement proper CSI VOLUME_MOUNT_GROUP support so kubelet passes the pod's fsGroup to the driver.
os.ModeSetgid(not octal02775) so new subdirectories created by kubelet forsubPathmounts inherit the fsGroup automaticallyTesting
Setup: Deployed Mimir via Helm on a test cluster with PVCs backed by csi-hyperstack StorageClass. Mimir pods run as non-root (runAsUser: 1001, fsGroup: 1001).
Reproducing the issue:
Testing the fix: