You have a Gerrit instance humming along nicely. Code reviews are disciplined, approvals are predictable, and then someone asks to move it to Google Cloud Run. Now you are staring at identity policies, service accounts, and ephemeral containers while thinking, “How exactly do I make Gerrit behave in this thing?” That question is why this topic exists.
Cloud Run is built for stateless, container-based workloads that scale on demand. Gerrit, on the other hand, is a constant—the beating heart of your code review process. When the two meet, the aim is simple: keep Gerrit’s access control and user visibility intact while letting Cloud Run handle the scaling and uptime. The challenge is both identity and persistence, and getting those right is what makes Cloud Run Gerrit go from headache to harmony.
How the Integration Actually Works
At its core, Gerrit needs stable storage for its repos and database plus an identity layer that understands who is reviewing code. Cloud Run provides the scaling and execution side, coupled with Cloud SQL or Filestore for persistence. You deploy Gerrit as a container image to Cloud Run, link it to persistent storage, and configure authentication through OIDC so it plugs easily into systems like Google Identity or Okta. Permissions map cleanly to Gerrit groups, giving precise rule-based reviews with minimal toil.
Best Practices That Save You Hours
Keep service account permissions minimal. Rotate secrets often. Use workload identity federation instead of static keys so Gerrit authenticates using short-lived credentials. Log approvals and changes through Cloud Audit Logs or Stackdriver to retain a transparent review history. These small moves make Cloud Run Gerrit secure, compliant, and fast to debug.