Skip to main content

Certification track: Professional Cloud Database Engineer (PCDE) · AI Tooling

Qdrant on Google Cloud Run

Qdrant on Google Cloud Run

Qdrant is a high-performance vector database and similarity search engine built for AI workloads — RAG pipelines, recommendation systems, semantic search, and embeddings storage. This module deploys Qdrant on Cloud Run v2 on top of the App_CloudRun foundation, which provisions and manages the shared Google Cloud infrastructure.

This guide focuses on the cloud services Qdrant uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics common to every Cloud Run application — service identity, ingress and load balancing, scaling and concurrency, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_CloudRun foundation guide rather than repeating them here.


1. Overview

Qdrant runs as a Cloud Run v2 (Gen2) service with a GCS FUSE-mounted Cloud Storage bucket for persistent collection storage. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2Qdrant service, 1 vCPU / 1 GiB by default, min_instance_count = 1
Persistent storageCloud Storage via GCS FUSE<prefix>-storage bucket mounted at /qdrant/storage via Gen2 GCS FUSE CSI
SecretsSecret ManagerOptional API key (QDRANT__SERVICE__API_KEY)
IngressCloud Run URL / Cloud Load BalancingDefault internal (VPC-only); optional HTTPS load balancer with Cloud Armor

Sensible defaults worth knowing up front:

  • No SQL database, no Redis. Qdrant manages its own embedded storage. No Cloud SQL instance or Redis dependency is created.
  • Single-instance by default. max_instance_count = 1 is strongly recommended. Qdrant is a single-writer store — multiple instances writing to the same GCS FUSE mount corrupt collections.
  • Internal ingress by default. ingress_settings = "internal" restricts access to the VPC. Changing to "all" (public internet) requires enable_api_key = true — a plan-time validation blocks the combination of public ingress without an API key.
  • Gen2 execution environment is required for GCS FUSE mounts. The module defaults to execution_environment = "gen2".
  • Two distinct health endpoints. Startup uses /readyz; liveness uses /livez. Never point the liveness probe at /readyz — Qdrant temporarily marks itself not-ready while loading large collections, causing spurious container restarts.
  • gRPC requires h2c protocol. Cloud Run does not expose port 6334. Use container_protocol = "h2c" and a gRPC client over the main port if gRPC is needed.

2. Google Cloud Services & How to Explore Them

All commands assume PROJECT and REGION are set. Service and resource names are reported in the deployment Outputs.

A. Cloud Run — the Qdrant service

Qdrant runs as a Cloud Run v2 service. Each deployment creates an immutable revision. The service scales between the minimum and maximum instance counts based on request concurrency.

  • Console: Cloud Run → select the service for revisions, traffic, logs, and metrics.
  • CLI:
    gcloud run services list --project "$PROJECT" --region "$REGION"
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION"
    gcloud run revisions list --service <service-name> --project "$PROJECT" --region "$REGION"

See App_CloudRun for scaling, concurrency, execution environment, and traffic splitting.

B. Cloud Storage — Qdrant persistent storage

Qdrant persists its WAL, collection data, HNSW index files, and metadata at /qdrant/storage inside the container. This path is backed by a Cloud Storage bucket (<prefix>-storage) mounted via GCS FUSE. The bucket is provisioned automatically by the module.

  • Console: Cloud Storage → Buckets — find the *-storage bucket.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"
    gcloud storage ls gs://<storage-bucket>/
    gcloud storage ls gs://<storage-bucket>/collections/

See App_CloudRun for GCS Fuse details and CMEK options.

C. Secret Manager — Qdrant API key

When enable_api_key = true, a 32-character alphanumeric API key is generated and stored in Secret Manager. It is injected as QDRANT__SERVICE__API_KEY at runtime, requiring all REST and gRPC callers to pass api-key: <key> in request headers.

  • Console: Security → Secret Manager — look for a secret named <resource-prefix>-api-key.
  • CLI:
    gcloud secrets list --project "$PROJECT"
    gcloud secrets versions access latest --secret=<api-key-secret> --project "$PROJECT"

See App_CloudRun for injection and rotation details.

D. Networking & ingress

By default the service is reachable only from within the VPC (ingress_settings = "internal"). An external HTTPS load balancer with a custom domain, Cloud CDN, and Cloud Armor can be layered on when the service needs to be reachable from outside the VPC.

  • Console: Cloud Run (service URL); Network services → Load balancing.
  • CLI:
    gcloud run services describe <service-name> --region "$REGION" \
    --format='value(status.url)'
    gcloud compute addresses list --project "$PROJECT"

See App_CloudRun.

E. Cloud Logging & Monitoring

Container logs flow to Cloud Logging; Cloud Run metrics flow to Cloud Monitoring. Optional uptime checks (against /readyz) and alert policies are available.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud run services logs read <service-name> --project "$PROJECT" \
    --region "$REGION" --limit 50

3. Qdrant Application Behaviour

  • No database bootstrap. Qdrant manages its own embedded storage engine. No initialization job is injected by default. The service starts immediately after the container is ready.
  • Collection loading on start. Qdrant loads all collections from GCS FUSE into memory during startup. For instances with large collections, startup can take tens of seconds. The startup probe (/readyz) waits for this to complete before traffic is sent to the instance.
  • Separate liveness and readiness endpoints. /readyz returns 503 while collections are loading; /livez always returns 200 while the process is alive. The liveness probe uses /livez to prevent spurious container restarts during collection load. Do not change the liveness probe to /readyz.
  • Single-writer constraint. Multiple Cloud Run instances cannot safely share the same GCS FUSE storage path. Keep max_instance_count = 1. Scale vertically (increase CPU and memory) for higher throughput.
  • gRPC over HTTP/2. Cloud Run does not expose a second port for gRPC. Use container_protocol = "h2c" together with a gRPC client that connects over HTTP/2 on port 6333 if gRPC is needed.
  • Scheduled tasks. Use cron_jobs to schedule periodic Qdrant collection snapshots via the REST API or for custom maintenance routines, run as Cloud Run Jobs.

4. Configuration Variables

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for Qdrant are listed; every other input is inherited from App_CloudRun with its standard behaviour.

Group 1 — Project & Identity

VariableDefaultDescription
project_id(required)Target Google Cloud project.
regionus-central1Region for the service and regional resources.

Group 2 — Deployment Environment

VariableDefaultDescription
tenant_deployment_iddemoShort suffix that makes resource names unique per environment.
support_users[]Emails granted project access and monitoring alerts.
resource_labels{}Labels applied to all resources.

Group 3 — Application Identity

VariableDefaultDescription
application_nameqdrantBase name for resources. Do not change after first deploy.
application_display_nameQdrant Vector DatabaseFriendly name shown in the Console.
application_versionlatestQdrant image version tag; pin to a semver tag for production (e.g. v1.9.0).
enable_api_keyfalseGenerate a random API key in Secret Manager; required before setting ingress_settings = "all".

Group 4 — Runtime & Scaling

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
cpu_limit1000mCPU per instance. Increase to 2000m4000m for production index builds and concurrent queries.
memory_limit1GiMemory per instance. Qdrant loads HNSW indexes into RAM — size based on collection dimensions and vector count.
min_instance_count1Minimum instances. Keep ≥ 1 to avoid cold starts during HNSW index loading.
max_instance_count1Maximum instances. Keep at 1 — Qdrant is a single-writer store.
container_port6333Qdrant REST API port.
execution_environmentgen2Gen2 required for GCS FUSE mounts.
timeout_seconds300Max request duration (0–3600 s). Increase for large batch upserts or snapshot operations.
enable_image_mirroringtrueMirror the Qdrant image into Artifact Registry to avoid Docker Hub rate limits.
container_protocolhttp1Use h2c to enable HTTP/2 for gRPC clients connecting over port 6333.
traffic_split[]Traffic allocation across revisions for canary or blue-green deployments.

Group 5 — Access & Ingress Control

VariableDefaultDescription
ingress_settingsinternalinternal (VPC-only, recommended), all (requires enable_api_key = true), or internal-and-cloud-load-balancing.
vpc_egress_settingPRIVATE_RANGES_ONLYHow outbound traffic is routed through the VPC connector.
enable_iapfalseRequire Google sign-in via Identity-Aware Proxy.
iap_authorized_users / iap_authorized_groups[]Who may access through IAP.

Group 6 — Environment Variables & Secrets

VariableDefaultDescription
environment_variables{}Extra non-secret settings. Use QDRANT__… keys to override Qdrant configuration.
secret_environment_variables{}Map of env var → Secret Manager secret name.
secret_propagation_delay30Seconds to wait after secret creation before proceeding.
secret_rotation_period2592000sSecret Manager rotation reminder period (30 days default).

Group 7 — Backup & Restore

VariableDefaultDescription
backup_schedule0 2 * * *Automated backup cron (UTC).
backup_retention_days7Retention; raise for production/compliance.
enable_backup_import / backup_source / backup_uri / backup_formatrestore optionsRestore from a backup on deploy.

Group 8 — CI/CD & Binary Authorization

Standard App_CloudRun Cloud Build / Cloud Deploy integration — see App_CloudRun. Key inputs: enable_cicd_trigger, github_repository_url, github_token, enable_cloud_deploy, enable_binary_authorization.

Group 9 — NFS & Custom SQL

VariableDefaultDescription
enable_nfsfalseQdrant uses GCS for storage — enable NFS only for custom init jobs that need a shared filesystem. Requires Gen2.
nfs_mount_path/mnt/nfsMount path inside the container.
enable_custom_sql_scriptsfalseNot applicable — Qdrant has no SQL database.

Group 10 — Load Balancer, CDN & Image Retention

VariableDefaultDescription
enable_cloud_armorfalseProvision Global HTTPS LB + Cloud Armor WAF.
admin_ip_ranges[]CIDRs exempted from WAF rules.
application_domains[]Custom domain names for the HTTPS LB (Google-managed SSL).
enable_cdnfalseEnable Cloud CDN on the HTTPS LB backend.
max_images_to_retain7Maximum recent container images to keep in Artifact Registry.

Group 11 — Storage & Filesystem

VariableDefaultDescription
create_cloud_storagetrueProvision the GCS storage bucket.
storage_buckets / gcs_volumes[]Additional buckets / GCS FUSE mounts.
manage_storage_kms_iam / enable_artifact_registry_cmekfalseCMEK options.

Group 13 — Jobs & Scheduled Tasks

VariableDefaultDescription
initialization_jobs[]Qdrant requires no default init job; provide only custom data loading or migration tasks.
cron_jobs[]Recurring Cloud Run Jobs for periodic collection snapshots or maintenance.

Group 14 — Observability & Health

VariableDefaultDescription
startup_probe/readyz, 15s delayHTTP probe — Qdrant reports ready once all collections are loaded.
liveness_probe/livez, 30s delayHTTP probe — dedicated liveness endpoint unaffected by collection load state.
uptime_check_configdisabled, /readyzCloud Monitoring uptime check.
alert_policies[]Metric alert policies.

Group 23 — VPC Service Controls & Audit Logging

VariableDefaultDescription
enable_vpc_scfalseEnforce a VPC-SC perimeter (requires organization_id).
vpc_cidr_ranges / vpc_sc_dry_run(set)Access level CIDRs / dry-run mode.
enable_audit_loggingfalseDetailed Cloud Audit Logs.

5. Outputs

Returned on a successful deployment — the quickest way to locate and explore the running resources.

OutputDescription
service_nameCloud Run service name.
qdrant_urlInternal VPC URL for the Qdrant REST API (port 6333). Only reachable from within the same VPC when ingress_settings = "internal".
service_locationRegion the service runs in.
stage_servicesStage-specific service URLs (Cloud Deploy).
load_balancer_ip / load_balancer_urlExternal HTTPS load balancer IP / URL (when enabled).
storage_bucketsCreated Cloud Storage buckets.
network_name / network_exists / regionsVPC network, presence, regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channels / uptime_check_namesMonitoring status, channels, uptime checks.
initialization_jobsNames of any custom setup jobs.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / github_repository_url / github_repository_owner / github_repository_name / cicd_configurationCI/CD status and details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.
audit_logging_enabled / artifact_registry_cmek_enabledAudit logging and CMEK status.

6. Configuration Pitfalls & Sensible Defaults

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

SettingSensible valueRiskConsequence if wrong
enable_api_keytrue (any external deployment)CriticalWithout an API key, any caller who can reach the service can read, modify, or delete all collections.
ingress_settingsinternal (default)CriticalSetting to "all" without enable_api_key = true is blocked at plan time; doing so exposes Qdrant to the public internet.
application_nameset onceCriticalImmutable after first deploy; changing recreates storage and loses all collections.
max_instance_count1HighMultiple instances writing to the same GCS FUSE path corrupt collections — Qdrant is a single-writer store.
liveness_probe path/livez (default)HighPointing liveness at /readyz causes spurious container restarts every time a large collection is loaded from GCS.
memory_limit4Gi for productionHighDefault 1Gi only supports small test collections; OOM kills terminate all in-flight queries and trigger a full index reload from GCS.
execution_environmentgen2 (default)HighGCS FUSE requires Gen2; Gen1 deployments with enable_nfs = true fail at plan time.
application_versionpin to semver for productionMediumUsing latest can cause an unintended storage-format upgrade that makes existing collections unreadable.
min_instance_count1MediumScale-to-zero causes a cold reload of all collections from GCS on the next request; avoid for latency-sensitive workloads.
timeout_seconds300MediumLarge ANN searches, batch upserts, or snapshot operations can exceed the default — increase to 600 or more for heavy workloads.
enable_iap / enable_cloud_armorenable for exposed deploymentsHighWithout access controls, the Qdrant REST API is reachable by any caller on the allowed network.
secret_propagation_delay30MediumIn large projects, Secret Manager replication may exceed 30 s; increase to 60 to prevent reading an empty API key secret.
backup_retention_days7 (raise for prod)MediumToo short for compliance retention.
enable_backup_importfalse unless restoringCriticalEnabling without a valid backup_uri fails the import job.

For the foundation behaviour referenced throughout — service identity, scaling and concurrency, ingress and load balancing, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_CloudRun. Qdrant-specific application configuration shared with the GKE variant is described in Qdrant_Common.