Deploying Flagsmith on Google Cloud
Overview
Flagsmith can be deployed on Google Cloud Platform using either of two approaches:
- Google Kubernetes Engine (GKE) with our Helm charts — recommended for production and enterprise deployments.
- Cloud Run — a simpler option for evaluation or smaller workloads.
For production and enterprise deployments, we recommend GKE with our Helm charts. This gives you full control over scaling, networking, and operational tooling.
GKE (Recommended for Production)
Cluster Setup
We recommend GKE Standard or GKE Autopilot depending on how much control you need over node configuration. Either mode works well with Flagsmith.
For node pool sizing guidance, see our sizing and scaling page. As a starting point, our recommended resource allocation per pod is 1 vCPU and 2 GB RAM.
Deploying Flagsmith with Helm
We publish official Helm charts for deploying Flagsmith on Kubernetes. Add the repository and install:
helm repo add flagsmith https://flagsmith.github.io/flagsmith-charts/
helm install -n flagsmith --create-namespace flagsmith flagsmith/flagsmith \
-f values.yaml
A minimal values.yaml for GKE with an external Cloud SQL database looks like this:
postgresql:
enabled: false
databaseExternal:
enabled: true
urlFromExistingSecret:
enabled: true
name: flagsmith-database-credentials
key: DATABASE_URL
api:
secretKeyFromExistingSecret:
enabled: true
name: flagsmith-secret-key
key: SECRET_KEY
replicacount: 2
frontend:
replicacount: 2
taskProcessor:
enabled: true
Create the Kubernetes secrets separately:
kubectl -n flagsmith create secret generic flagsmith-database-credentials \
--from-literal=DATABASE_URL="postgres://flagsmith:PASSWORD@CLOUD_SQL_IP:5432/flagsmith"
kubectl -n flagsmith create secret generic flagsmith-secret-key \
--from-literal=SECRET_KEY="$(openssl rand -hex 32)"
Do not use the in-cluster PostgreSQL for production deployments. Always use an externally managed database such as Cloud SQL for PostgreSQL.
For the full list of chart values — including ingress, PgBouncer, resource limits, and deployment strategy — see our Kubernetes and OpenShift deployment guide.
The chart source is available on GitHub: Flagsmith Helm Charts.
Database — Cloud SQL for PostgreSQL
We recommend Cloud SQL for PostgreSQL as the database for Flagsmith on GCP.
- PostgreSQL version: We run our SaaS platform on PostgreSQL 15. Versions 12 and above are supported.
- High availability: Enable regional HA for production workloads.
- Connectivity: Use private IP or the Cloud SQL Auth Proxy to connect from GKE.
- Connection pooling: For high-traffic deployments, enable PgBouncer via the Helm chart. See the PgBouncer section in our Kubernetes guide.
When starting for the first time, Flagsmith will create the database schema automatically. Schema upgrades happen seamlessly during application server upgrades.
Terraform
Terraform modules for provisioning GKE and Cloud SQL for Flagsmith deployments are planned. In the meantime, you can use the Helm chart to deploy Flagsmith onto an existing GKE cluster.
Cloud Run (Quick Start)
Cloud Run is well suited for evaluation and smaller deployments. For production and enterprise workloads, we recommend GKE with Helm charts.
We recommend running the unified Docker image on Cloud Run.
Study our docker-compose file to understand the base environment variables. All available environment variables are documented here.
Run a single Cloud Run service with at least 2 minimum instances to avoid cold starts, particularly for serving low-latency requests to the SDKs. For more sizing information, see our scaling page.
Use /health as the health-check endpoint for both the API and the frontend.
For the database, use Cloud SQL for PostgreSQL. We support PostgreSQL versions 12 and above; our SaaS platform runs on version 15.
When your deployment grows beyond evaluation, consider migrating to GKE with Helm charts for better control over scaling, networking, and operations.