Skip to content

Google Cloud Storage

FlexFS supports Google Cloud Storage (GCS) as a block store backend using the native GCS client library. Authentication is handled via service account JSON credentials or the Application Default Credentials (ADC) chain.

Create a dedicated GCS bucket for flexFS block storage:

Terminal window
gcloud storage buckets create gs://my-flexfs-blocks \
--location=us-central1 \
--uniform-bucket-level-access
  • Uniform bucket-level access: Recommended. FlexFS does not use object-level ACLs.
  • Public access prevention: Enable. FlexFS never requires public access.
  • Versioning: Not required.
  • Lifecycle rules: Not required. FlexFS manages its own block lifecycle.
  • Storage class: Standard is recommended for active workloads. Nearline or Coldline may be suitable for archival volumes with infrequent access.

Create a service account with the minimum required permissions:

Terminal window
# Create the service account
gcloud iam service-accounts create flexfs-block-store \
--display-name="flexFS Block Store"
# Grant Storage Object Admin on the bucket
gcloud storage buckets add-iam-policy-binding gs://my-flexfs-blocks \
--member="serviceAccount:flexfs-block-store@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/storage.objectAdmin"

The roles/storage.objectAdmin role grants the necessary permissions to read, write, and delete objects in the bucket.

Generate a service account key in JSON format:

Terminal window
gcloud iam service-accounts keys create flexfs-sa-key.json \
--iam-account=flexfs-block-store@PROJECT_ID.iam.gserviceaccount.com

When configuring the flexFS block store credentials:

  • blockUser: Not used for GCS native authentication (leave empty)
  • blockPass: The entire contents of the service account JSON key file

The JSON key is passed directly to the GCS client library for authentication.

When no blockPass is provided, flexFS creates the GCS client without explicit credentials, which causes it to use the Application Default Credentials (ADC) chain. This supports:

  • GCE instance metadata: On Compute Engine VMs, the attached service account is used automatically.
  • GKE Workload Identity: On GKE, the Kubernetes service account can be bound to a GCP service account.
  • GOOGLE_APPLICATION_CREDENTIALS: Set this environment variable to the path of a service account JSON key file.
  • gcloud auth application-default login: For local development.

ADC is the recommended authentication method for production deployments on GCP.

GCS also supports authentication via HMAC keys, which provide S3-compatible access. When using HMAC keys, configure GCS as an S3-compatible store:

  • API code: s3 (not gcs)
  • Endpoint: https://storage.googleapis.com
  • Region: The GCS region
  • blockUser: HMAC access ID
  • blockPass: HMAC secret

To create HMAC keys:

Terminal window
gcloud storage hmac create \
flexfs-block-store@PROJECT_ID.iam.gserviceaccount.com

When creating a block store via configure.flexfs (Enterprise) or the installer, provide:

FieldValue
Providergcp
RegionGCS location (e.g. us-central1)
APIgcs
BucketYour GCS bucket name
PrefixOptional key prefix for multi-tenant buckets
EndpointLeave empty for standard GCS
blockUserLeave empty (not used with native GCS auth)
blockPassService account JSON key contents (or leave empty for ADC)