Skip to content

Allow multiple volume handles/mount options for same bucket#558

Closed
chrisThePattyEater wants to merge 0 commit intoGoogleCloudPlatform:mainfrom
chrisThePattyEater:main
Closed

Allow multiple volume handles/mount options for same bucket#558
chrisThePattyEater wants to merge 0 commit intoGoogleCloudPlatform:mainfrom
chrisThePattyEater:main

Conversation

@chrisThePattyEater
Copy link
Copy Markdown
Collaborator

@chrisThePattyEater chrisThePattyEater commented Apr 9, 2025

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:
Recently, a customer tried mounting the same GCS bucket with different mount options but their pod got stuck initializing: b/394408963. This is not supported.
This pr allows multiple volume handles/mount options for same bucket by allowing users to provide a suffix :suffix which will be stripped during node publish volume but allows the webhook to treat the two as separate buckets
Which issue(s) this PR fixes:
Fixes #395976718
Does this PR introduce a user-facing change?:

This release introduces support for mounting the same bucket with different mount options by allowing users to append a custom suffix to the bucket name in the volume handle (e.g., my-bucket:suffix). The suffix is ignored during NodePublishVolume to ensure the correct bucket is mounted, but is retained in earlier stages to let the webhook treat the volumes as unique.

This unblocks use cases where workloads need to mount the same GCS bucket with distinct configurations (e.g., different mountOptions) across multiple volumes.
Example useage: 
volumes:
    - name: gcsfuse-volume-1
      csi:
        driver: "gcsfuse.csi.storage.gke.io"
        volumeAttributes:
          bucketName: "fuechr_fuse_csi_test:1"
          skipCSIBucketAccessCheck: "false" 
    - name: gcsfuse-volume-2
      csi:
        driver: "gcsfuse.csi.storage.gke.io"
        volumeAttributes:
          bucketName: "fuechr_fuse_csi_test:2"
          skipCSIBucketAccessCheck: "true"
these will access the same bucket 

How was this tested/validated:
mounted two volumes to one container with two different mount options using custom built image and verified sidecar containers are running
containers:
- name: gcsfuse-container-1
image: google/cloud-sdk:alpine
command:
- "sleep"
- "3600"
volumeMounts:
- name: gcsfuse-volume-1
mountPath: /mnt/gcsfuse-1
subPath: gcsfuse-mount
- name: gcsfuse-volume-2
mountPath: /mnt/gcsfuse-2
subPath: gcsfuse-mount
volumes:
- name: gcsfuse-volume-1
csi:
driver: "gcsfuse.csi.storage.gke.io"
volumeAttributes:
bucketName: "fuechr_fuse_csi_test:1"
skipCSIBucketAccessCheck: "false"
- name: gcsfuse-volume-2
csi:
driver: "gcsfuse.csi.storage.gke.io"
volumeAttributes:
bucketName: "fuechr_fuse_csi_test:2"
skipCSIBucketAccessCheck: "true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant