I need to mount a Google Cloud Storage Buckets to file system, and grant access to the web server.
Use the Google Cloud Storage FUSE (gcsfuse) tool to mount a Cloud Storage bucket to your Compute Engine instance.
- I have a bucket named yctin-bucket
- I want to mount this bucket to /cloud/yctin-bucket/
- I was generated the Google Service Key, and stored into /src/gcloud_service_account.json
Mounting a bucket
# create the directory
mkdir -p /cloud/yctin-bucket/
# mount the bucket with 777 permission
gcsfuse --key-file=/src/gcloud_service_account.json -o allow_other --dir-mode 777 --file-mode 777 yctin-bucket /cloud/yctin-bucket/
To unmount the bucket