Skip to content

Commit b34f718

Browse files
authored
docs: Update GCP self-hosting to recommend GKE with Helm charts (#7177)
1 parent 1419fef commit b34f718

File tree

1 file changed

+138
-10
lines changed
  • docs/docs/deployment-self-hosting/hosting-guides/cloud-providers

1 file changed

+138
-10
lines changed

docs/docs/deployment-self-hosting/hosting-guides/cloud-providers/google-cloud.md

Lines changed: 138 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,149 @@ sidebar_position: 20
66

77
## Overview
88

9-
We recommend running Flagsmith on Google Cloud Platform using the following services:
9+
Flagsmith can be deployed on Google Cloud Platform using either of two approaches:
1010

11-
- [Cloud Run](https://cloud.google.com/run) for the application server
12-
- [Cloud SQL/PostgreSQL](https://cloud.google.com/sql/postgresql) for the database
11+
- **[Google Kubernetes Engine (GKE)](#gke-recommended-for-production)** with our Helm charts — recommended for
12+
production and enterprise deployments.
13+
- **[Cloud Run](#cloud-run-quick-start)** — a simpler option for evaluation or smaller workloads.
1314

14-
## Cloud Run
15+
:::tip
1516

16-
Unless you have specific requirements, we recommend running the [unified Docker image](https://hub.docker.com/repository/docker/flagsmith/flagsmith).
17+
For production and enterprise deployments, we recommend GKE with our
18+
[Helm charts](https://github.com/Flagsmith/flagsmith-charts). This gives you full control over scaling, networking, and
19+
operational tooling.
1720

18-
It's best to study our [docker-compose file](https://github.com/Flagsmith/flagsmith/blob/main/docker-compose.yml) in order to set up the base environment variables. Further environment variables are [described here](/deployment-self-hosting/core-configuration/environment-variables).
21+
:::
1922

20-
Run a single Cloud Run service with at least two container instances running for failover. For more info on sizing, see our [scaling page](/deployment-self-hosting/scaling-and-performance/sizing-and-scaling). We recommend running with at least [2 minimum instances](https://cloud.google.com/run/docs/configuring/min-instances) to avoid cold starts, particularly in order to serve low-latency requests to the SDKs.
23+
---
24+
25+
## GKE (Recommended for Production)
26+
27+
### Cluster Setup
28+
29+
We recommend [GKE Standard](https://cloud.google.com/kubernetes-engine/docs/concepts/choose-cluster-mode) or
30+
[GKE Autopilot](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview) depending on how much
31+
control you need over node configuration. Either mode works well with Flagsmith.
32+
33+
For node pool sizing guidance, see our
34+
[sizing and scaling page](/deployment-self-hosting/scaling-and-performance/sizing-and-scaling). As a starting point, our
35+
recommended resource allocation per pod is 1 vCPU and 2 GB RAM.
36+
37+
### Deploying Flagsmith with Helm
38+
39+
We publish official Helm charts for deploying Flagsmith on Kubernetes. Add the repository and install:
40+
41+
```bash title="Install Flagsmith on GKE"
42+
helm repo add flagsmith https://flagsmith.github.io/flagsmith-charts/
43+
helm install -n flagsmith --create-namespace flagsmith flagsmith/flagsmith \
44+
-f values.yaml
45+
```
46+
47+
A minimal `values.yaml` for GKE with an external Cloud SQL database looks like this:
48+
49+
```yaml title="values.yaml"
50+
postgresql:
51+
enabled: false
52+
53+
databaseExternal:
54+
enabled: true
55+
urlFromExistingSecret:
56+
enabled: true
57+
name: flagsmith-database-credentials
58+
key: DATABASE_URL
59+
60+
api:
61+
secretKeyFromExistingSecret:
62+
enabled: true
63+
name: flagsmith-secret-key
64+
key: SECRET_KEY
65+
replicacount: 2
66+
67+
frontend:
68+
replicacount: 2
69+
70+
taskProcessor:
71+
enabled: true
72+
```
73+
74+
Create the Kubernetes secrets separately:
75+
76+
```bash title="Create secrets"
77+
kubectl -n flagsmith create secret generic flagsmith-database-credentials \
78+
--from-literal=DATABASE_URL="postgres://flagsmith:PASSWORD@CLOUD_SQL_IP:5432/flagsmith"
79+
80+
kubectl -n flagsmith create secret generic flagsmith-secret-key \
81+
--from-literal=SECRET_KEY="$(openssl rand -hex 32)"
82+
```
83+
84+
:::warning
85+
86+
Do not use the in-cluster PostgreSQL for production deployments. Always use an externally managed database such as
87+
[Cloud SQL for PostgreSQL](#database--cloud-sql-for-postgresql).
88+
89+
:::
90+
91+
For the full list of chart values — including ingress, PgBouncer, resource limits, and deployment strategy — see our
92+
[Kubernetes and OpenShift deployment guide](/deployment-self-hosting/hosting-guides/kubernetes-openshift).
93+
94+
The chart source is available on GitHub: [Flagsmith Helm Charts](https://github.com/Flagsmith/flagsmith-charts).
95+
96+
### Database — Cloud SQL for PostgreSQL
97+
98+
We recommend [Cloud SQL for PostgreSQL](https://cloud.google.com/sql/docs/postgres) as the database for Flagsmith on
99+
GCP.
100+
101+
- **PostgreSQL version:** We run our SaaS platform on PostgreSQL 15. Versions 12 and above are supported.
102+
- **High availability:** Enable [regional HA](https://cloud.google.com/sql/docs/postgres/high-availability) for
103+
production workloads.
104+
- **Connectivity:** Use [private IP](https://cloud.google.com/sql/docs/postgres/connect-instance-private-ip) or the
105+
[Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine) to connect from GKE.
106+
- **Connection pooling:** For high-traffic deployments, enable PgBouncer via the Helm chart. See the
107+
[PgBouncer section](/deployment-self-hosting/hosting-guides/kubernetes-openshift#pgbouncer) in our Kubernetes guide.
108+
109+
When starting for the first time, Flagsmith will create the database schema automatically. Schema upgrades happen
110+
seamlessly during application server upgrades.
111+
112+
### Terraform
113+
114+
:::info
115+
116+
Terraform modules for provisioning GKE and Cloud SQL for Flagsmith deployments are planned. In the meantime, you can use
117+
the Helm chart to deploy Flagsmith onto an existing GKE cluster.
118+
119+
:::
120+
121+
---
122+
123+
## Cloud Run (Quick Start)
124+
125+
:::note
126+
127+
Cloud Run is well suited for evaluation and smaller deployments. For production and enterprise workloads, we recommend
128+
[GKE with Helm charts](#gke-recommended-for-production).
129+
130+
:::
131+
132+
We recommend running the [unified Docker image](https://hub.docker.com/repository/docker/flagsmith/flagsmith) on Cloud
133+
Run.
134+
135+
Study our [docker-compose file](https://github.com/Flagsmith/flagsmith/blob/main/docker-compose.yml) to understand the
136+
base environment variables. All available environment variables are
137+
[documented here](/deployment-self-hosting/core-configuration/environment-variables).
138+
139+
Run a single Cloud Run service with at least
140+
[2 minimum instances](https://cloud.google.com/run/docs/configuring/min-instances) to avoid cold starts, particularly
141+
for serving low-latency requests to the SDKs. For more sizing information, see our
142+
[scaling page](/deployment-self-hosting/scaling-and-performance/sizing-and-scaling).
143+
144+
Use `/health` as the health-check endpoint for both the API and the frontend.
145+
146+
For the database, use [Cloud SQL for PostgreSQL](https://cloud.google.com/sql/docs/postgres). We support PostgreSQL
147+
versions 12 and above; our SaaS platform runs on version 15.
21148

22-
If you are using health checks, make sure to use `/health` as the health-check endpoint for both the API and the frontend.
149+
:::tip
23150

24-
## Cloud SQL/PostgreSQL
151+
When your deployment grows beyond evaluation, consider migrating to
152+
[GKE with Helm charts](#gke-recommended-for-production) for better control over scaling, networking, and operations.
25153

26-
We support PostgreSQL versions `12+`. Our SaaS platform runs in production on PostgreSQL version `15`. When starting for the first time, the application will create that database schema automatically. Schema upgrades will also happen seamlessly during application server upgrades.
154+
:::

0 commit comments

Comments
 (0)