Git, CI/CD & GitOpsXCVIII · Git Hosting FailureSelf-hosted platform operations
Self-hosted forge and CI control-plane lifecycle
What you'll learn
- Model a self-hosted forge/CI platform as a stateful production control plane
- Identify database, repository, object-storage, queue, identity, mail, DNS, TLS, and runner dependencies
- Define backup consistency, restore order, and independent recovery credentials
- Plan upgrades with compatibility checks, rollback boundaries, and database migration constraints
- Choose HA and capacity controls based on measured failure domains rather than product labels
Prerequisites
Practice
Verified against Git 2.55.x teaching target; 2.40+ minimum · GitHub Actions continuous service; Aug 2026 documentation baseline · Argo CD v3.5.x teaching target; v3.0+ minimum · Flux v2.9.x · Sigstore Cosign v3.1.x · SLSA v1.2 · OCI Distribution Specification v1.1 · Git LFS v3.7.1 · Kubernetes (cross-course target) 1.36.x · 2026-08-25
A self-hosted Git or CI platform becomes the path through which every other production change travels. Calling it “internal tooling” does not reduce its availability, integrity, confidentiality, or recovery requirements. If it is unavailable, teams cannot review or ship. If it loses integrity, attackers can change source, workflows, credentials, or artifacts. If it cannot be restored, the organization has lost part of its operational memory.
Model the complete state graph
The visible web process is only one node:
| State or dependency | What it contains | Typical failure if omitted from operations |
|---|---|---|
| Git repository storage | Objects, refs, LFS objects, hooks, wikis | Clone/push failure or incomplete history |
| Relational database | Projects, users, permissions, issues, approvals, pipeline metadata | Repositories exist but ownership and audit context disappear |
| Object storage | Artifacts, packages, uploads, job logs, backups | Pipelines and releases cannot be reconstructed |
| Queue/cache | Background jobs, sessions, coordination | Stalled mail, hooks, cleanup, indexing, or pipeline scheduling |
| Secrets and keys | Encryption keys, OAuth secrets, signing keys, runner tokens | Restored data is unreadable or identities cannot authenticate |
| Identity provider | SSO, groups, MFA policy, emergency local accounts | Operators lock themselves out during an IdP outage |
| SMTP | Invitations, password recovery, alerting, approval notifications | Control-plane failures become silent; recovery flows fail |
| DNS, TLS, proxy/LB | Stable endpoint and trust chain | Runners, webhooks, and users fail despite healthy application processes |
| Runners/agents | Execution capacity and network reach | Control plane is healthy but no work runs |
The inventory must name the owner, version, location, backup method, restore order, monitoring, and dependency for every row. A VM snapshot of the web node is not a platform backup.
Choose a platform from operating requirements
GitLab integrates repository hosting, pipelines, registry, packages, and many supporting services, which increases both capability and recovery scope. Jenkins is primarily an automation controller whose plugins and controller state are part of its supply chain. Forgejo and Gitea provide a smaller forge surface, while CI commonly comes from Actions-compatible runners or another controller. The correct choice depends on:
- required source, review, package, registry, and CI features;
- user and repository scale, concurrency, artifact volume, and growth;
- database/object-storage operations already supported by the organization;
- SSO, MFA, audit, retention, and compliance needs;
- supported backup, restore, upgrade, and HA procedures;
- plugin/action ecosystem risk and update cadence; and
- the number of operators capable of restoring it at 03:00.
A product with more features but no practiced restore owner is less available than a smaller platform the team can rebuild from evidence.
Backup consistency and restore order
A recoverable set must capture repository storage, database, object storage, configuration, and secrets at a mutually consistent recovery point. Product backup utilities coordinate some of these boundaries; storage snapshots alone may not. Record the platform version and configuration beside every backup.
The restore plan normally proceeds:
- Establish clean hosts, DNS isolation, time, storage, and certificates.
- Install the exact compatible platform version without exposing it to users.
- Restore database and repository/object state according to vendor order.
- Restore secrets and encryption keys through an independent recovery path.
- Validate repository fsck/sample clones, permissions, protected branches, approvals, artifacts, package/registry objects, audit events, and webhooks.
- Reconnect SSO, SMTP, runners, integrations, mirrors, and public ingress.
- Re-enable writes only after reconciliation and acceptance tests pass.
Upgrade and rollback boundaries
Before an upgrade, read the supported upgrade path and intermediate-version requirements; verify OS, database, object-store, runner, plugin, and API compatibility; restore the current backup into isolation; drain writes and background jobs as required; record configuration; and establish abort criteria.
Database migrations create the rollback boundary. After an irreversible migration, rolling application binaries back while keeping the new database may be unsupported. The safe rollback may be a full restore of database, repositories, object storage, configuration, and secrets to the pre-upgrade recovery point. State this before starting, including the RPO cost of writes accepted after the migration.
Plugins, actions, and extensions are executable dependencies. Pin them, review their permissions and maintainers, stage their upgrades, inventory their configuration, and keep the controller able to start with non-essential extensions disabled.
HA is dependency-specific
Two web replicas behind a load balancer are not an HA platform when they share one database, filesystem, Redis node, object store, identity provider, or failure domain. For each stateful dependency define:
- failure unit and quorum/consistency model;
- placement across power, host, rack, zone, or site boundaries;
- client failover and connection behavior;
- backup independent of replication;
- maintenance sequence and capacity with one member unavailable; and
- the alert that proves redundancy has already been consumed.
Capacity plans track repository count/size, LFS and artifact growth, database size and latency, object count, concurrent jobs, queue depth, clone/push rate, webhook throughput, runner wait time, backup duration, restore duration, and headroom during node loss or maintenance.
Observability and operating cadence
Monitor user journeys, not just processes: authenticate, list a repository, clone/fetch, create a test ref, enqueue a pipeline, allocate a runner, upload and retrieve an artifact, deliver a webhook, and send mail. Alert separately on availability, integrity, capacity, security, and recoverability.
The operating cadence includes certificate and secret expiry, failed backups, restore age, database/storage growth, queue backlog, runner saturation, pending upgrades, vulnerable plugins/actions, audit-log export, emergency-account use, and dependency redundancy. A quarterly isolated restore is the evidence gate; “backup job succeeded” is not.
Phase-two execution contract
Phase two chooses one platform and proves install, TLS, SSO/emergency access, SMTP, repository and artifact operation, backup, isolated restore, supported upgrade, rollback boundary, monitoring, and teardown. Until that evidence is captured, this lesson describes the operating model but does not claim a tested platform lifecycle.
Knowledge check
Knowledge check · 4 questions
Q1. Which backup set is sufficient for a stateful forge?
Q2. Which checks belong before a self-hosted CI/forge upgrade? Select all that apply.
Q3. Name at least three independent state or dependency domains that must be restored with a self-hosted forge.
Q4. Assess this apparent HA design.
Two forge web nodes run behind a load balancer, but both use one database VM, one NFS server, and one SSO provider. The platform is advertised as highly available.
Passing score: 75%. Answers are checked in this browser.