Architecture Decision Record

ADR 002: Self-Hosted Gitea with In-Cluster CI

The Git server, CI runners, and container registry all live inside the cluster they deploy — sovereignty traded against a bootstrap circularity I chose to own.

Status: Accepted  ·  Date: July 2025  ·  ← All ADRs


Context

GitOps needs a Git host, CI needs runners, and images need a registry. The real shortlist was two — GitHub, or self-host with Gitea — with a glance at the heavier open-source options:

Decision

Gitea runs in the cluster, backed by the platform’s own CloudNativePG cluster (ADR 010) and Synology-backed storage. Its built-in registry is the private registry for every custom image. CI is Gitea Actions with an act_runner StatefulSet using a Docker-in-Docker sidecar, capacity two parallel jobs. Terraform manages the org, repos, and teams; Renovate keeps dependencies moving.

Reasoning

Tradeoffs

Outcome

Nine CI-driven releases of big-ads shipped through this pipeline with no manual steps. Custom MCP server images build and publish here. The circular-dependency question — “what if the cluster hosting your Git dies?” — has a rehearsed answer, which is more than most setups with the same architecture can say.