refactor(iac): cluster split — 1 cluster per plane, breakpilot-* naming
ci / shared (pull_request) Successful in 23s
ci / validate (pull_request) Successful in 4s

Restructures the draft to reflect the 2026-06-30 cluster decision:

Three Orca clusters, each becoming its own Gitea repo at migration time:
- breakpilot-edge   → vm-edge       (Identity + Infra: KC, Gitea, Infisical, PowerDNS, Orca-Proxy)
- breakpilot-control → vm-control   (Portal, tenant-registry, ERPNext, MariaDB, Stalwart)
- breakpilot-app    → vm-app-prod + vm-app-stage (CERTifAI, compliance-*, Mongo, MinIO, Qdrant, LiteLLM)

Key model points encoded:
- Identity (Keycloak) co-tenant with Infra on vm-edge (1 VM core), per
  INFRASTRUCTURE.md §6 — heap pinned so it cannot starve PowerDNS/Infisical
- Stage and prod live in the same breakpilot-app cluster on different
  VMs. Stage authenticates via prod Keycloak under tenant.kind = "stage";
  no duplicated identity, no duplicated control plane (per §5).
- The existing CERTifAI Keycloak will be repurposed for breakpilot-edge
  rather than standing up a fresh one — same realm, same users.
- Multi-VM rollout gated on legal entity being established so we can sign
  SysEleven / Hetzner business contracts. Until then, single-VM ops
  continues via ~/workspace/orca-infra; this repo is design-only.

Mechanical changes:
- manifests/{vm-edge,vm-control,vm-data,stage}/ → clusters/{breakpilot-edge,breakpilot-control,breakpilot-app/services/{prod,stage}}/services/
- vm-data → vm-app-prod, stage → vm-app-stage in node references and headers
- overlays/{stage,prod}/overlay.toml point at the new cluster paths
- scripts/validate.sh now enforces a per-cluster node whitelist
  (breakpilot-edge → vm-edge, breakpilot-control → vm-control,
  breakpilot-app → {vm-app-prod, vm-app-stage}) instead of dir-name equality
- New READMEs at clusters/, clusters/breakpilot-edge/,
  clusters/breakpilot-control/, clusters/breakpilot-app/ documenting
  scope, SLA targets, co-tenant notes, and the future-repo split
- Top README rewritten to lead with the cluster-split decision and the
  legal-entity gate; per-milestone fill-in table re-pathed

Validation:
- make validate → 38 files OK (35 manifests + 3 overlays)
- make plan ENV=stage → 11 resolved manifests in .orca-out/stage/
- make plan ENV=prod  → 24 resolved manifests in .orca-out/prod/
This commit is contained in:
Sharang Parnerkar
2026-06-30 22:14:51 +02:00
parent f1c3fd14b9
commit 8971152da0
44 changed files with 428 additions and 125 deletions
+42
View File
@@ -0,0 +1,42 @@
# breakpilot-edge
Identity + Infra plane. Single VM (`vm-edge`).
Becomes its own Gitea repo `platform/breakpilot-edge` at migration time.
## Services (8)
| Service | Purpose |
|---|---|
| [`gitea.toml`](./services/gitea.toml) | Source forge — every config change to every cluster lands here |
| [`infisical.toml`](./services/infisical.toml) | Secret store. Every other plane's `${secrets.*}` resolves here |
| [`keycloak.toml`](./services/keycloak.toml) | Single tenant of truth for identity. **Repurposed from `certifai` Keycloak — same realm, same users**. |
| [`orca-proxy.toml`](./services/orca-proxy.toml) | Ingress for vm-edge: TLS termination + Let's Encrypt ACME for `*.breakpilot.com` |
| [`pg-infisical.toml`](./services/pg-infisical.toml) | Infisical's Postgres |
| [`pg-keycloak.toml`](./services/pg-keycloak.toml) | Keycloak's Postgres |
| [`powerdns-auth.toml`](./services/powerdns-auth.toml) | Authoritative DNS for `breakpilot.com`; bound to port 53 on vm-edge |
| [`redis-infisical.toml`](./services/redis-infisical.toml) | Cache + session store for Infisical |
## SLA targets (per `INFRASTRUCTURE.md §6`)
```
Owns: AVAILABILITY ≥ 99.5% (root dep for every other plane)
RTO ≤ 15 min (Keycloak)
AUDIT_TRAIL — realm-level audit (logins, token issuance, IdP events)
DATA_RESIDENCY — Keycloak realm data must stay EU
STAGE_ISOLATION — rate-limits stage_client_id; rejects stage JWTs in prod audiences
```
## Co-tenant note
Keycloak's JVM heap is pinned to 1.5 GB in `keycloak.toml`
(`JAVA_OPTS_APPEND = "-Xms1g -Xmx1500m"`) so it cannot starve PowerDNS or
Infisical. If the heap fight ever shows up in alerts, the escape hatch is
to peel Keycloak off onto its own VM inside the same cluster — no schema
migration, just a `placement.node` flip.
## Bootstrap exception
Per `INFRASTRUCTURE.md §8 rule 3`, `KC_DB_URL` lives in Orca env (not in
Infisical), because Infisical runs on the same VM and we'd otherwise have
a circular bootstrap dependency.
@@ -0,0 +1,25 @@
# gitea stub — full config lands in M3.x.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
[[service]]
name = "gitea"
image = "gitea/gitea:1.22"
port = 3000
domain = "git.breakpilot.com"
[service.placement]
node = "vm-edge"
[service.resources]
memory = "512Mi"
cpu = 0.5
[service.volume]
path = "/data"
[service.env]
USER_UID = "1000"
USER_GID = "1000"
GITEA__database__DB_TYPE = "sqlite3"
GITEA__database__PATH = "/data/gitea/gitea.db"
GITEA__server__ROOT_URL = "https://git.breakpilot.com"
@@ -0,0 +1,22 @@
# infisical stub — full config lands in M3.1.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
[[service]]
name = "infisical"
image = "infisical/infisical:latest"
port = 8080
depends_on = ["pg-infisical", "redis-infisical"]
[service.placement]
node = "vm-edge"
[service.resources]
memory = "512Mi"
cpu = 0.5
[service.env]
DB_CONNECTION_URI = "${secrets.INFISICAL_DB_URI}"
REDIS_URL = "redis://redis-infisical:6379"
ENCRYPTION_KEY = "${secrets.INFISICAL_ENCRYPTION_KEY}"
AUTH_SECRET = "${secrets.INFISICAL_AUTH_SECRET}"
SITE_URL = "https://infisical.breakpilot.com"
@@ -0,0 +1,25 @@
# keycloak stub — full config lands in M2.1.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
# Bootstrap exception per §8 rule 3: KC_DB_URL lives in Orca env, not Infisical (Infisical runs on same VM).
[[service]]
name = "keycloak"
image = "quay.io/keycloak/keycloak:26.0"
port = 8443
domain = "auth.breakpilot.com"
depends_on = ["pg-keycloak"]
[service.placement]
node = "vm-edge"
[service.resources]
memory = "2Gi"
cpu = 1.0
[service.env]
KC_DB = "postgres"
KC_DB_URL = "${secrets.KC_DB_URL}"
KC_HOSTNAME = "auth.breakpilot.com"
KC_PROXY_HEADERS = "xforwarded"
KC_HEALTH_ENABLED = "true"
JAVA_OPTS_APPEND = "-Xms1g -Xmx1500m"
@@ -0,0 +1,15 @@
# orca-proxy stub — full config lands in M1.2/M0.3.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
# Wildcard TLS terminator; routing rules land with M0.3.
[[service]]
name = "orca-proxy"
image = "orca-managed/orca-proxy:placeholder"
port = 443
[service.placement]
node = "vm-edge"
[service.resources]
memory = "256Mi"
cpu = 0.5
@@ -0,0 +1,22 @@
# pg-infisical stub — full config lands in M3.1.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
[[service]]
name = "pg-infisical"
image = "postgres:16-alpine"
port = 5432
[service.placement]
node = "vm-edge"
[service.resources]
memory = "256Mi"
cpu = 0.25
[service.volume]
path = "/var/lib/postgresql/data"
[service.env]
POSTGRES_DB = "infisical"
POSTGRES_USER = "infisical"
POSTGRES_PASSWORD = "${secrets.PG_INFISICAL_PASSWORD}"
@@ -0,0 +1,22 @@
# pg-keycloak stub — full config lands in M2.1.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
[[service]]
name = "pg-keycloak"
image = "postgres:16-alpine"
port = 5432
[service.placement]
node = "vm-edge"
[service.resources]
memory = "512Mi"
cpu = 0.5
[service.volume]
path = "/var/lib/postgresql/data"
[service.env]
POSTGRES_DB = "keycloak"
POSTGRES_USER = "keycloak"
POSTGRES_PASSWORD = "${secrets.PG_KEYCLOAK_PASSWORD}"
@@ -0,0 +1,15 @@
# powerdns-auth stub — full config lands in M0.3.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
[[service]]
name = "powerdns-auth"
image = "powerdns/pdns-auth:4.9"
port = 53
extra_ports = ["53:53/udp", "53:53/tcp"]
[service.placement]
node = "vm-edge"
[service.resources]
memory = "256Mi"
cpu = 0.25
@@ -0,0 +1,15 @@
# redis-infisical stub — full config lands in M3.1.
# Host: vm-edge. Resource budget per INFRASTRUCTURE.md §6 co-tenant notes.
# Ephemeral cache; no volume.
[[service]]
name = "redis-infisical"
image = "redis:7-alpine"
port = 6379
[service.placement]
node = "vm-edge"
[service.resources]
memory = "128Mi"
cpu = 0.1