Plan: real high-availability path for Forgejo (replicas>1) #381
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/infrastructure#381
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why this exists
A request to scale
deploy/forgejoto 2 replicas surfaced that the current setup cannot safely run more than one pod. Naively scaling would land both pods on the single node sharing oneReadWriteOncedata dir and risk corrupting git repos / LFS / bleve indexers, with zero availability gain. This issue captures the proper HA path instead.Upstream caveat to set expectations: Forgejo's own helm HA docs state Forgejo is not fully HA-ready yet due to race conditions in the queue, cron, and cache processes without leader-follower logic. So "HA" here means horizontally-scaled + zero-downtime deploys + node-failure tolerance, not a fully race-free guarantee.
Current single points of failure
kai-serveris the only node; everything (Forgejo, postgres, runners) runs there. Replicas alone buy nothing against node failure.local-pathPVC.forgejo-data(/var/lib/gitea: git repos, LFS, attachments, avatars, bleve indexers) isReadWriteOncenode-local storage. Cannot be shared across nodes.db(the one piece already HA-friendly). Multiple instances would diverge / duplicate background work.forgejo-dbStatefulSet is one replica — itself a SPOF.Recreatestrategy. Forces full downtime on every deploy; incompatible with zero-downtime rollout.Required changes (per Forgejo helm HA docs)
db(OK, can stay or move)Proposed phased rollout
Phase 1 - zero-downtime deploys on the current single node (no node-failure HA yet).
forgejonamespace.[cache] ADAPTER=redis,[queue] TYPE=redis, optionally[session] PROVIDER=redis, pointing at Valkey.ISSUE_INDEXER_TYPE=meilisearch+ a Meilisearch pod, ordbas a lighter interim) and disable the repo indexer (REPO_INDEXER_ENABLED=false)./var/lib/gitea(Longhorn RWX or an NFS export), uid/gid 1000.Recreate->RollingUpdate, setreplicas: 2.kai-server-> no protection from node loss.Phase 2 - true node-failure HA.
podAntiAffinityto spread Forgejo replicas across nodes (requires the Phase 1 RWX storage to actually be cross-node, e.g. Longhorn/NFS, not local-path).Open decisions for Kai
Sources
Filed instead of scaling to 2 replicas, which would have risked data corruption with no HA benefit on the current single-node RWO setup.
Triage:
P3/consult- Plan issue for Forgejo HA; design/planning, no code yet.(goose-style pass; claude as the judgment engine, applied 2026-06-23)