Forgejo on GKE Autopilot
Forgejo is a lightweight, community-managed, self-hosted Git service — a fork of Gitea — providing repository hosting, issue tracking, pull requests, a built-in CI/CD (Actions) runner, code review, and a package registry from a single Go binary. This module deploys Forgejo on GKE Autopilot on top of the App_GKE foundation, which provisions and manages the shared Google Cloud and Kubernetes infrastructure.
This guide focuses on the cloud services Forgejo uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics that are common to every GKE application — Workload Identity, ingress, autoscaling, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_GKE foundation guide rather than repeating them here.
What Forgejo costs on RAD, and how that compares
In a Google Cloud project you own, Forgejo on RAD's GKE Autopilot module costs about US$143 a month, plus US$11 once per deployment and no per-user licence. For the lowest cost, the Cloud Run module runs the same Forgejo for about US$84 a month. Forgejo is a lightweight, self-hosted Git forge and community fork of Gitea, with repository hosting, issues, pull requests and a built-in Actions runner. Figures are as at 8 October 2026; sources are listed at the end of this section.
If this runs in a project RAD manages for you, it can be deleted and restored within 30 days for a few credits instead of sitting there running — so an occasional-use deployment costs a few dollars a month, not US$143. See Pause it for free, below.
What you pay on RAD
| In a Google Cloud project you own | In a project RAD manages for you | |
|---|---|---|
| Module fee, once per deployment | 110 credits (US$11 at the top-up price) | 99 credits (10% lower) |
| Build time | A few credits per build | The same |
| Google Cloud running cost | Billed by Google to your own billing account, about US$143 a month for the default configuration (table below) | Metered hourly in credits; RAD publishes 108 credits a day, about 3,240 a month (about US$324 at the top-up price) |
| Who owns what | You own the project and its billing; RAD deploys and updates it | RAD owns the project, with guardrails, quotas and budget alerts; you get console access, and a minimum purchased balance is held in reserve |
10 credits cost US$1 on a one-off top-up, and less on a monthly plan. In a project RAD manages, the database, file server and network are shared by every application in the project, so a second application does not add a second database.
Default running cost in your own project (us-central1, Google list prices):
| Resource (module default) | Per month |
|---|---|
| GKE Autopilot pod, 2 vCPU / 2 GiB, running all the time | US$72 |
| Cloud SQL for PostgreSQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSD | US$51 |
| NFS/cache file server: a small VM | US$13 |
| Cloud NAT gateway and IP address | US$5 |
| Cloud Storage for backups | US$1 |
| Total | about US$143 |
GKE's free tier covers the management fee of one Autopilot or zonal cluster per billing account, so the total above assumes this is that cluster; otherwise add about US$73 a month.
How it compares
We could not find a commercial managed/SaaS plan specifically for Forgejo itself as at 8 October 2026, so the honest comparison is against running it yourself:
| Option | Per month | Who runs it |
|---|---|---|
| Hetzner CPX22 (2 vCPU/4GB) | ~US$24 | You: OS, updates, backups, security patches |
| DigitalOcean 2 vCPU/4GB Droplet | US$24 | You: OS, updates, backups, security patches |
| GCP Compute Engine e2-standard-2 (2 vCPU/8GB) | ~US$49 | You: OS, updates, backups, security patches |
| RAD, GKE Autopilot, your own project | US$143, plus US$11 once | RAD's automation, in your project |
| RAD, Cloud Run | about US$84; see the Cloud Run guide | RAD |
- RAD is usually not cheaper in cash than a bare VPS — the difference is what is managed for you. A VPS price does not include the admin's own time for backups, security patches and OS upgrades; RAD's managed Cloud SQL (where this app uses a database), Secret Manager and monitoring cover that instead.
- Forgejo is a lightweight, self-hosted Git forge and community fork of Gitea, with repository hosting, issues, pull requests and a built-in Actions runner. That shapes which column matters: predictable, hands-off operation is worth more to most teams running this kind of tool than shaving a few dollars off the monthly bill.
Pause it for free: delete a RAD-managed project, restore it when you need it
If Forgejo runs in a project RAD manages for you, you have an option beyond scaling down: delete the whole project, and restore it within 30 days for close to nothing. This suits a deployment you only need occasionally — studying for a certification, a demo, a seasonal need — far better than running it continuously.
- How it works. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project. Google does not remove it immediately: it keeps it, recoverable, for 30 days, and because billing is already unlinked, nothing is charged while it waits. Unlike deleting one module, this does not tear down Cloud SQL, the VM or GKE Autopilot one by one — the whole project, and everything in it, simply stops.
- Restoring costs a handful of credits, not a rebuild. Within 30 days, the project's owner can restore it. RAD asks Google to undelete the project and reattaches its billing account, then asks you to run Update on each deployment to confirm everything came back. Because nothing was individually destroyed, that Update finds the same resources already there — it is a check, not a rebuild, and an Update never charges the module fee again. That costs a handful of build-time credits in total (under US$1) for a typical 2–3-deployment chain.
- So a month of occasional use can cost a few dollars, not US$143. Deploy Forgejo, use it for a session, delete the project. Restore it next time you want it, confirm with Update, and delete it again when you're done. You pay only for the module fee once, the builds, and whatever hours it was actually live.
- What this needs. You must own the project (not a bring-your-own one RAD only manages billing for), and you restore it yourself within the 30 days — after that, Google deletes it for good. Restoring is admitted like creating a new project: your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study/demo use fits). Google says most services are fully working again within 36 hours of a restore.
- One real gap: nightly backups do not survive. Backups are written to a bucket inside the project, and that bucket has Cloud Storage's soft-delete explicitly turned off, so it is very likely gone as soon as you delete the project — even though the project itself is recoverable for 30 days. If you've customised this deployment and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before deleting. For a default install with nothing irreplaceable in it, this does not matter.
Pay only while you use it, the other way: delete and redeploy
GKE keeps at least one pod running, so Forgejo never scales to zero on its own. The option above only applies to a RAD-managed project; in your own project, or once the 30-day window has passed, the way to stop paying is to delete the deployment and deploy it again when you need it.
- What a redeploy costs. The module fee again plus the builds: about 115 credits (US$11.50). Deleting saves money if Forgejo would otherwise sit unused for about 3 days or more in your own project (about US$4.75 a day), or about 1 day or more in a RAD-managed one (108 credits a day).
- Delete everything Forgejo uses. Most of the running cost is usually the database and any shared file/cache VM. They stop only when nothing else in the project uses them, so deleting this app while something else shares the project saves only this app's own compute part.
- Keep data first. Nightly backups go to a bucket inside the deployment and are deleted with it, so copy the latest backup out before deleting if you want to keep it.
- Note your settings. RAD does not recreate a deleted deployment for you; you enter the settings again when you deploy.
Lab sessions and Managed Environments
- Lab sessions, for training. A trainer runs a session for a class. Each participant gets Forgejo in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place, or each participant pays for their own. Everything is deleted when the session ends and unused credits go back to the trainer.
- Managed Environments, for consultancies. A partner runs the app for a client from a ring-fenced wallet it funds, and settles with the client directly. If the wallet runs low, billing pauses and the data is kept, so nobody receives an unexpected charge. At the end the partner hands the project over and the deployments become the client's own.
Credits can be bought in more than 20 currencies, including XAF, XOF, NGN, GHS, KES and ZAR, by card, bank transfer or mobile money.
Sources (8 October 2026): Google Cloud list prices from the Cloud Billing Catalog API; RAD's own fees and daily-credit estimate from radmodules.dev/pricing; Delete and restore projects for the pause/restore mechanism. Prices change; check each source before relying on a figure.
1. Overview
Forgejo runs as a single Go binary supervised by s6 inside the stock
codeberg.org/forgejo/forgejo image, wrapped by a thin platform entrypoint that
composes the database connection at runtime. The deployment wires together a
focused set of Google Cloud services:
| Capability | Google Cloud service | Notes |
|---|---|---|
| Compute | GKE Autopilot | Forgejo pods on port 3000 (HTTP), 2 vCPU / 2Gi by default |
| Database | Cloud SQL for PostgreSQL 15 | Locked in practice — db-init.sh uses psql; the database_type dropdown lists MYSQL/NONE as options but they are not supported |
| File persistence | Cloud Filestore (NFS) | Enabled by default; repositories, LFS objects and attachments live under the NFS mount (/mnt/nfs), shared across pods |
| Object storage | Cloud Storage | A generic, unused data-suffixed bucket is provisioned by the foundation default — Forgejo itself stores nothing in GCS |
| Secrets | Secret Manager | Auto-generated SECRET_KEY and INTERNAL_TOKEN, plus the database password; delivered to pods via CSI-mounted files because the GKE SecretSync CRD forbids __ in synced-secret keys |
| Ingress | Cloud Load Balancing (Gateway API) | External LoadBalancer with a reserved static IP; custom domain support is enabled by default, falling back to an auto-provisioned nip.io HTTPS hostname when no domain is set |
Sensible defaults worth knowing up front:
- PostgreSQL 15 is the only engine that actually works.
database_typedefaults toPOSTGRES_15; thedb-initjob's script is written entirely againstpsql, so selecting MySQL orNONEbreaks database setup even though the variable metadata lists them as options. - Cloud SQL is reached via the Auth Proxy sidecar on loopback.
enable_cloudsql_volume = trueby default, so acloud-sql-proxysidecar listens on127.0.0.1:5432; the platform entrypoint selectsSSL_MODE=disablefor that hop. - Deployment (not StatefulSet), NFS-backed, scale-to-zero capable.
workload_type = "Deployment",min_instance_count = 0,max_instance_count = 3. Becauseenable_nfs = trueby default, the foundation forces theRecreaterollout strategy (see App_GKE) so an update never runs two pods against the same NFS volume and database simultaneously. - NFS is enabled by default, mounted at
/mnt/nfs(GITEA__server__APP_DATA_PATH) — this is where repositories, Git LFS objects, and attachments persist. - Session affinity is
ClientIP. - No separate migration job.
GITEA__security__INSTALL_LOCK = "true"skips Forgejo's web installer; theforgejo/forgejoimage creates and migrates its own schema on container start against the empty database thedb-initjob prepared. - No admin account is bootstrapped by Terraform. There is no init job that creates a Forgejo admin user — see Section 3 for the manual step.
SECRET_KEYandINTERNAL_TOKENare auto-generated and stored in Secret Manager; on GKE they (and the DB password) are read from CSI-mounted secret files via Forgejo's nativeGITEA__section__KEY__FILEconvention.public_domain/public_urldefault tolocalhost. Even thoughenable_custom_domain = trueauto-provisions a reachable HTTPS endpoint,GITEA__server__DOMAIN/GITEA__server__ROOT_URLare not automatically synced to it — setpublic_domain(and optionallypublic_url) to the real external hostname so clone URLs and links resolve correctly.- Self-registration is open by default (
GITEA__service__DISABLE_REGISTRATION = "false"). - Redis is provisioned but not actually wired into Forgejo's config.
enable_redis = trueby default and the foundation injectsREDIS_HOST/REDIS_PORTinto the container, butForgejo_Commonsets noGITEA__cache__*/GITEA__session__*/GITEA__queue__*variables to consume them — Forgejo falls back to its built-in cache/session defaults unless you add that wiring yourself viaenvironment_variables.
2. Google Cloud Services & How to Explore Them
All commands assume you have run
gcloud container clusters get-credentials <cluster> --region <region> --project <project>
and that PROJECT, REGION, and NAMESPACE are set. The namespace and other
identifiers are reported in the deployment Outputs.
A. GKE Autopilot — the Forgejo workload
Forgejo pods run the codeberg.org/forgejo/forgejo image behind a thin custom
build that installs a platform entrypoint (/platform-entrypoint.sh), then execs
the stock Forgejo entrypoint under s6. Because the workload is NFS-backed by
default, the Deployment uses the Recreate strategy.
- Console: Kubernetes Engine → Workloads → select the Forgejo workload for pods, revisions, and events. Kubernetes Engine → Services & Ingress shows the external IP.
- CLI:
kubectl get pods,svc -n "$NAMESPACE" --selector app=forgejo 2>/dev/null || kubectl get pods,svc -n "$NAMESPACE"
kubectl logs -n "$NAMESPACE" deploy/<service-name> --tail=100
kubectl describe pod -n "$NAMESPACE" -l app=<service-name>
See App_GKE for how Autopilot, scaling, and the workload type (Deployment vs StatefulSet) are managed.
B. Cloud SQL for PostgreSQL 15
Forgejo stores all application metadata (users, repositories, issues, pull
requests, Actions runs) in a managed Cloud SQL for PostgreSQL 15 instance. Pods
reach it through the Cloud SQL Auth Proxy sidecar on 127.0.0.1:5432; no
public IP is exposed. On first deploy the db-init job creates the application
role and database; Forgejo then creates and migrates its own schema on first
container start.
- Console: SQL → select the instance for connections, backups, flags, metrics.
- CLI:
gcloud sql instances list --project "$PROJECT"
gcloud sql instances describe <instance-name> --project "$PROJECT"
gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"
The instance name, database, user, and the Secret Manager secret holding the password are all in the Outputs. See App_GKE for the connection model, automated backups, and password rotation.
C. Cloud Filestore (NFS) — repository storage
Forgejo's repository data, Git LFS objects, and attachments live on NFS
(Cloud Filestore), mounted inside the pod at /mnt/nfs by default
(GITEA__server__APP_DATA_PATH). No GCS bucket is used for application data —
Forgejo_Common always reports an empty storage_buckets output — though the
generic storage_buckets variable default still creates one unused
data-suffixed bucket unless overridden.
- Console: Filestore → Instances; Cloud Storage → Buckets.
- CLI:
gcloud filestore instances list --project "$PROJECT"
kubectl get pvc -n "$NAMESPACE"
gcloud storage buckets list --project "$PROJECT" --filter="name~data"
See App_GKE for NFS discovery/creation and GCS Fuse mounts.
D. Secret Manager
Two Forgejo secrets are generated automatically and stored in Secret Manager:
SECRET_KEY (encrypts sensitive data such as 2FA and OAuth tokens) and
INTERNAL_TOKEN (authenticates Forgejo's own internal API calls). The database
password is the foundation-managed secret. On GKE, all three are projected into
pods as files via the Secret Store CSI driver and read by Forgejo through the
GITEA__section__KEY__FILE convention (GITEA__database__PASSWD__FILE,
GITEA__security__SECRET_KEY__FILE, GITEA__security__INTERNAL_TOKEN__FILE) —
because the GKE SecretSync CRD rejects __ in a synced-secret's targetKey,
these are materialised under the simple keys SECRET_KEY / INTERNAL_TOKEN
rather than the GITEA__ names used on Cloud Run.
- Console: Security → Secret Manager.
- CLI:
gcloud secrets list --project "$PROJECT" --filter="name~forgejo"
gcloud secrets versions access latest --secret=<secret-key-secret-name> --project "$PROJECT"
See App_GKE for the Secret Store CSI integration and rotation.
E. Networking & ingress
By default the workload is exposed through an external Cloud Load Balancing IP
(service_type = LoadBalancer, reserve_static_ip = true so the address
survives redeploys) fronted by a Gateway (enable_custom_domain = true), which
provisions an automatic nip.io HTTPS hostname when no application_domains
are supplied. Only the HTTP port (container_port = 3000) is wired into the
Kubernetes Service — Forgejo's internal sshd (supervised by the same s6
process, per the Dockerfile) is not exposed by this module, so
git+ssh:// clone URLs are not reachable externally without additional,
manually-added networking.
- Console: Network services → Load balancing; VPC network → IP addresses.
- CLI:
kubectl get svc,gateway -n "$NAMESPACE"
gcloud compute addresses list --project "$PROJECT"
See App_GKE for custom domains, Cloud CDN, and static IP details.
F. Cloud Logging & Monitoring
Pod stdout/stderr flow to Cloud Logging; GKE and Cloud SQL metrics flow to Cloud Monitoring. Optional uptime checks and alert policies are available.
- Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
- CLI:
gcloud logging read 'resource.type="k8s_container" AND resource.labels.namespace_name="'"$NAMESPACE"'"' \
--project "$PROJECT" --limit 50
3. Forgejo Application Behaviour
- First-deploy database setup. The
db-initjob runsdb-init.shusingpostgres:15-alpine. It waits for Cloud SQL to accept connections, idempotently creates (or re-passwords) the application role withCREATEDB, creates the database owned by that role, and grants full database +publicschema privileges (PG15+). No Postgres extensions are installed by the script itself. The job is safe to re-run (execute_on_apply = true,max_retries = 3) and signals the Cloud SQL Auth Proxy sidecar to shut down (POST /quitquitquitonlocalhost:9091) so the Job container exits cleanly. - No separate migration job — schema creation happens on container boot.
With
GITEA__security__INSTALL_LOCK = "true", Forgejo's web installer is skipped; the stockforgejo/forgejoentrypoint creates and migrates the schema in the empty database on first start, and applies further migrations on subsequent version upgrades. - No admin account is created automatically. No initialization job runs a
forgejo admin user create(or equivalent) step, and self-registration is enabled (GITEA__service__DISABLE_REGISTRATION = "false"), so anyone who can reach the service can create an account. The operator-side step to bootstrap the first administrator is tokubectl execinto a running pod and use Forgejo's own admin CLI. TODO: the exact CLI invocation and confirmation that the CLI binary is onPATHinside the deployed container were not verified from this repository's source — confirm against the running pod (kubectl exec -n "$NAMESPACE" deploy/<service-name> -- forgejo admin user create --help) before relying on it. - DB connection env-var wiring. The foundation injects
DB_HOST(the Cloud SQL Auth Proxy loopback address on GKE),DB_NAME,DB_USER, and theDB_PASSWORDsecret. Because Kubernetes-style$(VAR)references are not used (Cloud Run doesn't interpolate them, so the same entrypoint works on both platforms),/platform-entrypoint.shcomposesGITEA__database__{HOST,NAME,USER,SSL_MODE}at runtime from the injectedDB_*values, selectingSSL_MODE=disablefor the Unix-socket / loopback-proxy hops used on GKE.GITEA__database__PASSWDis not injected directly on GKE; instead Forgejo reads it from the CSI-mountedGITEA__database__PASSWD__FILE. - NFS-backed rollouts use
Recreate. Updates terminate the old pod before starting the new one, avoiding two pods writing to the same repository data on NFS.max_instance_countstill defaults to3(not1) — Forgejo is not a single-writer app in the same sense as a SQLite-backed one, but no multi-replica correctness testing for concurrent Git writes against the same NFS-backed data directory is documented in this module, so treat scaling beyond a single steady-state replica with the same caution as any other shared-filesystem workload. - Health path. Both probes are HTTP
GET /api/healthz, which Forgejo serves without authentication once database migrations complete: startup probeinitial_delay_seconds=0,timeout_seconds=10,period_seconds=30,failure_threshold=10; liveness probeinitial_delay_seconds=60,timeout_seconds=5,period_seconds=30,failure_threshold=3. - Inspect the init job and running config:
kubectl get jobs -n "$NAMESPACE"
kubectl logs -n "$NAMESPACE" job/<db-init-job-name>
kubectl exec -n "$NAMESPACE" deploy/<service-name> -- env | grep GITEA__
4. Configuration Variables
Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for Forgejo are listed; every other input is inherited from App_GKE with its standard behaviour and defaults.
Group 3 — Application Identity
| Variable | Default | Description |
|---|---|---|
application_name | forgejo | Base name for resources. Do not change after first deploy. |
application_version | 11 | codeberg.org/forgejo/forgejo image tag, applied via the app-specific FORGEJO_VERSION build arg (latest maps to the pinned 11). |
description | Forgejo - Self-hosted Git service and source-code hosting | Populates the workload description field. |
Group 4 — Runtime & Scaling
| Variable | Default | Description |
|---|---|---|
container_image_source | custom | Builds a thin wrapper FROM codeberg.org/forgejo/forgejo:${FORGEJO_VERSION} that adds the platform DB-wiring entrypoint. |
container_port | 3000 | Forgejo HTTP port; also sets GITEA__server__HTTP_PORT. |
enable_cloudsql_volume | true | Cloud SQL Auth Proxy sidecar on loopback — required on GKE. |
cpu_limit | 2000m | 2 vCPU per pod (Forgejo-specific override of the generic container_resources default). |
memory_limit | 2Gi | 2Gi per pod (Forgejo-specific override). |
Group 6 — GKE Backend & Cluster
| Variable | Default | Description |
|---|---|---|
workload_type | Deployment | Deployment (NFS-backed, Recreate strategy — see App_GKE). |
service_type | LoadBalancer | External IP for the Forgejo UI/Git-over-HTTP. |
session_affinity | ClientIP | Sticky routing so a client reaches the same pod. |
public_domain | localhost | Sets GITEA__server__DOMAIN; used to build clone URLs and links. Override before/after first deploy. |
public_url | "" → http://<public_domain>/ | Sets GITEA__server__ROOT_URL. |
Group 10 — Observability & Health
| Variable | Default | Description |
|---|---|---|
startup_probe | HTTP /api/healthz, failure_threshold=10, period_seconds=30 | App-specific startup probe (see Section 3). |
liveness_probe | HTTP /api/healthz, initial_delay_seconds=60, period_seconds=30, failure_threshold=3 | App-specific liveness probe. |
Group 13 — Filesystem (NFS)
| Variable | Default | Description |
|---|---|---|
enable_nfs | true | NFS is on by default so repositories, LFS objects, and attachments persist and are shared across pods. |
nfs_mount_path | /mnt/nfs | Mounted path, also set as GITEA__server__APP_DATA_PATH. This is the effective default for this module — the Forgejo_Common module's own internal default (/data) is overridden by this variant. |
Group 15 — Redis
| Variable | Default | Description |
|---|---|---|
enable_redis | true | Injects REDIS_HOST (defaulting to the NFS server IP) / REDIS_PORT into the container, but Forgejo_Common does not set any GITEA__cache__* / GITEA__session__* config to consume them — see the caution in Section 1. |
redis_host | "" | Override to point at Cloud Memorystore or another Redis instance. |
redis_port | 6379 | Redis port. |
redis_auth | "" (sensitive) | Redis AUTH password, if required. |
Group 16 — Database Backend
| Variable | Default | Description |
|---|---|---|
database_type | POSTGRES_15 | The only engine db-init.sh supports — do not change. |
db_name | forgejo | Database name, injected as GITEA__database__NAME. Immutable after first deploy. |
db_user | forgejo | Database user, injected as GITEA__database__USER; password auto-generated in Secret Manager and delivered via GITEA__database__PASSWD__FILE. |
enable_postgres_extensions | true | postgres_extensions defaults to ["uuid-ossp"]. Forgejo's own schema does not require any Postgres extension; this is a foundation-level convenience default. |
Group 19 — Custom Domain, Static IP & Networking
| Variable | Default | Description |
|---|---|---|
enable_custom_domain | true | Provisions a Gateway with a static IP; falls back to an auto-generated nip.io hostname when application_domains is empty. |
application_domains | [] | Custom hostnames + managed certificate. |
reserve_static_ip | true | Stable external IP across redeploys. |
All other inputs follow standard App_GKE behaviour.
5. Outputs
These values are returned on a successful deployment and are the quickest way to locate and explore the running resources.
| Output | Description |
|---|---|
service_name | Kubernetes Service name. |
namespace | Namespace the workload runs in. |
service_cluster_ip | In-cluster ClusterIP. |
stage_service_cluster_ips | Map of ClusterIPs for stage-specific services. |
service_external_ip | External LoadBalancer IP (when a static IP is reserved). |
service_url | URL to reach Forgejo. |
database_instance_name | Cloud SQL instance name. |
database_name / database_user | Application database name / user. |
database_password_secret | Secret Manager secret holding the DB password. |
database_host / database_port | DB endpoint (127.0.0.1 via the Auth Proxy) / port. |
storage_buckets | Created Cloud Storage buckets (the generic, unused data-suffixed bucket by default). |
network_name / network_exists / regions | VPC network, presence, available regions. |
container_image / container_registry | Deployed image and Artifact Registry repo. |
monitoring_enabled / monitoring_notification_channels | Monitoring status and channels. |
initialization_jobs / db_import_job | Names of the setup (db-init) and (optional) import jobs. |
deployment_id / tenant_id / resource_prefix | Naming identifiers. |
project_id / project_number | Project identifiers. |
cicd_enabled / cicd_configuration | CI/CD status and details (repo, trigger, registry). |
github_repository_url / github_repository_owner / github_repository_name | CI/CD GitHub details. |
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_id | Registry and build trigger. |
kubernetes_ready | Whether the cluster/workload is ready. |
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_mode | VPC-SC status. |
audit_logging_enabled / artifact_registry_cmek_enabled | Audit 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).
Inherited plan-time validation. This module passes its configuration through the App_GKE foundation engine, which validates values and combinations at plan time — a
StatefulSetforced alongside a stateless setting, IAP with no authorized identities,quota_memory_*given as bare integers, an out-of-rangecontainer_port/backup_retention_days. Invalid configuration fails the plan with a clear, named error before any resource is created, so most mistakes below are caught up front rather than at apply or runtime.
| Setting | Sensible value | Risk | Consequence if wrong |
|---|---|---|---|
database_type | POSTGRES_15 | Critical | db-init.sh is psql-only; MySQL/NONE breaks database setup even though the variable metadata lists them. |
db_name / db_user | Set once | Critical | Immutable after first deploy; renaming recreates the DB/user and orphans all repositories, issues, and PRs stored against the old role. |
SECRET_KEY / INTERNAL_TOKEN (auto-generated) | Never change | Critical | Rotating these invalidates 2FA/OAuth-encrypted data and Forgejo's own internal API auth, breaking Git and API operations. |
enable_nfs | true | Critical | Disabling it makes repositories, LFS objects, and attachments ephemeral — lost on pod recreation. |
enable_cloudsql_volume | true | High | The Auth Proxy sidecar on 127.0.0.1:5432 is required for DB connectivity on GKE; the entrypoint's SSL-mode selection assumes it. |
public_domain / public_url | Real external hostname | High | Defaults to localhost / http://localhost/, producing wrong Git clone URLs and broken links until overridden. |
GITEA__service__DISABLE_REGISTRATION (via environment_variables) | true for non-public instances | High | Self-registration is open by default and no admin account is auto-created — anyone reaching the service can sign up. |
| Initial admin account | Create manually post-deploy | High | No init job bootstraps an admin; until one is created via the Forgejo CLI, the instance has no privileged user. |
enable_redis | true, but confirm it is actually needed | Medium | REDIS_HOST/REDIS_PORT are injected with no effect unless you also add the matching GITEA__cache__*/GITEA__session__* config — provisioning Redis capacity for no benefit otherwise. |
max_instance_count | 3 (default) | Medium | Concurrent replicas share the same NFS-backed Git data directory and Postgres DB; multi-replica correctness for concurrent writes is not documented here — treat scaling like any shared-filesystem workload. |
quota_memory_requests / _limits | binary units (4Gi, 8192Mi) | Critical | Bare integers are treated as bytes and block all pod scheduling in the namespace. |
storage_buckets | Leave as-is or set create_cloud_storage = false | Low | The default data-suffixed bucket is provisioned but unused by Forgejo (all app data lives on NFS) — minor unnecessary cost if left enabled needlessly. |
reserve_static_ip | true | Medium | Without it, the external IP can change across redeploys, breaking DNS and public_domain/public_url. |
backup_retention_days | 7 (raise for prod) | Medium | Too short for compliance retention. |
For the foundation behaviour referenced throughout — IAM and Workload Identity, autoscaling, ingress and certificates, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_GKE. Forgejo-specific application configuration shared with the Cloud Run variant is described in Forgejo_Common.
Related guides
- Hands-on lab: Forgejo on GKE Autopilot — deploy it step by step, with the console screens and commands at each stage.
- Forgejo on Google Cloud Run — the same application on Cloud Run, for when you need the other deployment target.
- Forgejo Common — Shared Application Configuration — the configuration shared by both deployment targets.
Need RAD to do something it does not do yet? Request it on the roadmap, or vote on what is already there.