Unified migrations plan

Status (2026-11-09)

The fabric exists and is running. What follows is the honest state of each phase on a live substrate, including the blockers - a phase with an unresolved prerequisite is recorded as blocked, not as "in progress".

phasestateevidence, or what blocks it
0 - pre-sealed bootstrap clusterBUILTA dedicated bootstrap cluster runs under GitOps (Flux 2.9.6, self-managing sync path). Rebuilt twice from the repository alone after its resolver and Docker-socket requirements were understood. Secrets are ciphertext in git; the decryption identity is delivered as the sops-age bootstrap secret, never in the repository
1 - the cluster fabricBUILTCluster API (Docker provider) provisions four clusters - Inference, Agents, Security, Databases - from one ClusterClass declared in git. All four report Available, each with a control plane and a worker, each running its own Flux with flux-system, infrastructure, sealed-secrets and workloads reconciling. Sealing lands before any workload: sealed-secrets is a Kustomization that exists from the first commit
2 - read models and projectorsBLOCKEDDepends on Phase 3: projectors need events to consume
3 - the event backboneBLOCKEDRedpanda ships only as a Helm chart. The platform standard forbids a chart as the deployment path, so the bus needs either an upstream plain release manifest or a first-party operator. This is a real gap, not a preference
4 - supply chain and pipelinesSTARTEDTekton is installed on the Agents cluster from its plain release manifest (controller, webhook, events, resolvers all Ready). Chains, signing (Fulcio/Rekor) and the gate policies are not yet in
5 - inference and agent surfacesNOT STARTEDNeeds GPU capacity the substrate does not have; KubeAI/vLLM cannot be honestly claimed without it
6 - identity and the hardened planeSTARTEDThe Security cluster carries cert-manager and Kyverno plus the mainframe-baseline ClusterPolicy (audit). SPIRE, Keycloak, OpenBao and Falco are not in yet
7 - observabilityNOT STARTEDClickHouse, the OTel collector and SigNoz are unbuilt
8 - migrating off the running mainframeNOT STARTEDCloudNativePG - the target for the eleven single-superuser databases - is installed on the Databases cluster. No live data has been moved: that phase is sequenced last for a reason

Phase 1 exit criterion, verified

The exit criterion was: all four clusters exist, are GitOps-managed, and a kubectl from a human to the Security cluster fails.

  • all four clusters exist and report Available;
  • each is GitOps-managed by its own Flux, reconciling from the same repository;
  • the Security cluster's API endpoint is published only on the internal container network - nothing listens on it from the host's public interface, so no human credential reaches it. Every object on it arrives through GitOps.

Blockers found while building, recorded rather than smoothed over

  1. The CNI is not in the class. Cluster API's quick-start ClusterClass installs no CNI, so nodes never reach Ready and KubeadmControlPlane remediates them in a loop. Delivered via ClusterResourceSet, one bundle per trust domain.
  2. The upstream kindnet manifest carries a placeholder (${DOCKER_POD_CIDRS}) that CAPD normally substitutes. Applied verbatim, kindnetd panics and pods lose all egress. The placeholder is resolved per cluster.
  3. ClusterResourceSet with ApplyOnce never re-applies a corrected resource - the fix is strategy: Reconcile plus a fresh binding.
  4. The management cluster must reach the workload APIs. They sit on a different container network; without the route, the addon controller reports "connection to the workload cluster is down" and the CNI never lands.
  5. The bootstrap cluster must expose the Docker socket for the Docker provider, and must not inherit the host's DNS search domain (a wildcard in the search zone made the git host resolve to an edge that refuses the handshake).

What this unifies

Two architectures exist and neither document knows about the other.

The running mainframeThe specified target
Wherestack.md, definition-of-ready/done.md and the security viewpointthe deployed VPS, Talos, 40 containers
ShapeKubernetes, four clusters, Redpanda, CQRS, Tekton, SPIREDocker Compose, Headscale, a registry graph
Statusnormative and under REVIEWlive today

The plan below migrates the second onto the first and unifies a third thing neither addresses: the platform's own registries, which are already a declarative source of truth and should ride the same rails as the spec corpus.

The unification principle

The spec corpus has VIEW documents. The platform has registries. They are the same kind of artefact: a declarative statement of intent with an owner, a status, a change log and derived consumers.

The target architecture already names the mechanism - projectors. So the plan applies one rule everywhere:

Every VIEW and every registry gets a projector. The projector consumes CloudEvents and materialises a read model. Nothing reads the source document directly.

That single rule collapses a large amount of the migration into one repeatable pattern, and it is what makes CQRS real rather than aspirational.

Command side (writes): a ticket changes, a registry changes, a document is promoted. The change is validated and emits a CloudEvent.

Query side (reads): projectors consume those events and update their read model. A consumer asking "what is in the stack" queries the read model, never the markdown.

Server-Side Apply plays the same role one layer down: declarative desired state, the cluster reconciles, field ownership is tracked rather than fought over.

The three SSA layers

SSA resolves to three things and all three are in scope. They are layers of one question - who holds authority - and the full treatment with measured findings is in ssa-authority-model.md. The plan accounts for all three:

layerauthority overfixing phaseMainframe state today
Server-Side Applycluster statePhase 1a cluster with no reconciler
Self-Sovereign Architectureexternal dependenciesPhase 5mostly sovereign, one undeclared exception (LiteLLM to OpenRouter)
Sealed Secrets Authoritykey materialPhase 0 and 6unsplit unseal key on one host, no ceremony

The sequencing consequence, stated because it changes the phase order: Sealing must precede the first workload in every new cluster, which is why Phase 0 exists at all. A cluster built before its secret authority is established has a window in which plaintext existed, and that window is the audit finding.

The uncomfortable consequence: Sealed Secrets Authority cannot be satisfied by a solo operator. Splitting a key with a threshold requires a second custodian, and a ceremony requires someone to hold the other share. Phase 0 and Phase 6 are therefore gated on a person, not on work.

Phase 0 - The pre-sealed bootstrap cluster

Goal: a cluster that can be rebuilt from git plus one sealed key, with no interactive step and no human-held plaintext.

elementchoice
ProvisioningPulumi, so the bootstrap is code and the boundary is auditable
Isolationself-contained. The bootstrap cluster reaches out to build the clusters; nothing reaches in
Sealingsealed before workloads land. Secrets exist as ciphertext in git from the first commit, so a lost bootstrap never means a lost platform
Who may touch itno human directly. GitOps only, two-reviewer approval

The ordering matters more than the components. Sealing must precede the first workload, because retro-fitting a sealed secret store means a period in which plaintext existed, and that period is the finding an auditor will look for.

Exit criteria: a bootstrap cluster is destroyed and rebuilt from the repository and the sealed key alone, with no manual step.

Phase 1 - The cluster fabric

Cluster API on the bootstrap cluster provisions and owns four workload clusters. The four are not arbitrary - each exists because it has a different trust level.

clusterpurposetrust levelwho has access
InferencevLLM under KubeAI, LangFuse, Llama Guard 3, LLM Guard, NVIDIA GPU Operatormoderateplatform engineers
Agentsagent runtime, the fourteen MCP servers, MCP Guard, gVisor-isolated node poollowest - assumed compromisedplatform engineers
SecuritySPIRE, Keycloak, OpenBao, cert-manager, Fulcio, Rekor, Falcohighestno human, GitOps only
DatabasesCloudNativePG, MongoDB (Percona), Neo4j, OpenSearch, pgvector, RedishighDBAs via GitOps

Three properties are load-bearing and must survive every later phase:

  1. No human has direct access to the production Security cluster. If an operator can kubectl exec into SPIRE, the trust root is a person away from compromise.
  2. The Agents cluster is assumed hostile. gVisor isolation, risk-segmented egress, MCP Guard on every MCP call. Agent fallibility is designed for, not denied.
  3. Server-Side Apply is the single apply path. Declarative desired state, the API server as arbiter of field ownership, conflicts surfaced rather than silently overwritten. No human applies to a cluster by hand. The Mainframe has a cluster and no reconciler today, so this is a new control rather than a change to an existing one - and the tooling is the easy half. The rule is the hard half.

The private substrate uses k3s with k3k for nested clusters; k3d is the local development shape so a developer's laptop matches the target closely enough to be useful.

Exit criteria: all four clusters exist, are GitOps-managed, and a kubectl from a human to the Security cluster fails.

Phase 2 - The read models, and the projector wave

This is the phase the unification principle pays for. One pattern, applied many times.

sourceprojectorread model
stack.mdstack-projectorMongoDB - current component inventory, queryable by type, cluster and owner
definition-of-ready.mddor-projectorPostgreSQL - the gate criteria as rows, so a checker evaluates rather than parses
definition-of-done.mddod-projectorPostgreSQL - DoD criteria and the acceptance gate
the security viewpointsecurity-projectorMongoDB - controls, residual risks, opened tensions
the platform registriesregistry-projectorNeo4j - the existing graph, now event-fed rather than batch-collected

Why each VIEW gets its own projector rather than one generic one. A VIEW's read model should be shaped for its consumers, not for its author. The stack read model wants to answer "what runs on the inference cluster"; the DoD read model wants to answer "which criteria gate this ticket". A generic document projector answers neither well.

MongoDB for document-shaped read models, PostgreSQL for relational ones, Neo4j for graph ones. That is the whole architecture decision, and it is driven by access pattern rather than by taste.

Exit criteria: every VIEW has a projector, every projector has a read model, and a consumer can answer a real question without opening a markdown file.

Phase 3 - The event backbone

| element | role | | --- | --- | --- | | Redpanda | the domain bus. Kafka-compatible, single binary, no ZooKeeper | | Schema Registry | Avro, Protobuf and JSON compatibility enforced at the bus | | Bus sidecar | Kyverno-injected into every event-consuming pod. Deserialise, retry, dead-letter - without changing event semantics | | Publisher Service | validates write-side commands, publishes CloudEvent-wrapped domain events | | Connectors | the boundary that lets the spec corpus emit into the bus without the corpus caring that it is event-driven |

The sidecar is the quiet win. Because Kyverno injects it, no service author writes event plumbing, and no service can silently opt out. Consistency is a cluster property rather than a code-review property - the same reasoning the mainframe already applies to its own registries.

Exit criteria: a document change propagates to every consumer read model with no direct call between producer and consumer.

Phase 4 - Supply chain and pipelines

Tekton is the sole pipeline engine. Everything that produces an artefact routes through it.

stagecomponents
BuildTekton, Tekton Chains
ProveSyft (SBOM), Grype, Trivy, Trivy Operator
SignFulcio, Rekor
GateSonarQube, Microcks, Kyverno image-signature validation
UpdateRenovate
DispatchPipeline Dispatcher

Two commitments from the corpus carry into the plan unchanged and both are non-negotiable:

  • Generated artefacts MUST be signed and attested. The DoD requires it, and the pipeline is the only place it can be true.
  • Renovate PRs are a live threat path. The threat model ranks upstream dependency compromise second. Hermetic builds and Falco are the compensating controls and both must land before Renovate is enabled at breadth.

Exit criteria: no artefact reaches a cluster without a signature and an SBOM, and the pipeline proves it without a human assertion.

Phase 5 - Inference and agent surfaces

elementrole
KubeAIcontrol plane for vLLM serving, prefix-aware routing, lifecycle
vLLMthe serving backend. PagedAttention, continuous batching, tensor and pipeline parallelism
LangFuseLLM observability, prompt management, evaluation tracing
Llama Guard 3 + LLM Guardcontent safety gate and input/output scanning proxy
PageIndexhierarchical tree retrieval, vendored, called through LiteLLM
Agent Runtimeupstream VS Code and Copilot harness with Rust first-party adapters

A conflict to resolve rather than paper over: the stack lists vLLM twice - at 34 and again at 81, with near-identical descriptions. That is not a duplicate component, it is an unmerged edit. The plan treats it as one component and the register records it as an open item.

LangFuse is deliberately not part of the operational telemetry store. The stack is explicit that LLM observability is a distinct concern from ClickHouse and SigNoz. Keeping them separate is correct - an LLM trace has a different retention, cost and audience than a service metric.

Exit criteria: an agent call is served, traced in LangFuse, safety-gated, and observable without touching the operational telemetry path.

Phase 6 - Identity and the hardened plane

layercomponents
Workload identitySPIRE (x509-SVIDs, federated across all three substrates), Istio mTLS
Human identityKeycloak (OIDC/OAuth 2.0)
SecretsOpenBao, dynamic credentials, PKI backend
Certificatescert-manager
PolicyKyverno - admission, mutation, image signature
DetectionFalco, Tetragon
Runtime isolationgVisor for agent workloads

The signing key MUST live in the secrets manager PKI engine, never on the filesystem. The corpus states it and the plan inherits it without softening: filesystem key material is the single most common way a trust root is lost.

The unseal ceremony is a migration deliverable, not an afterthought: Shamir shards, no single holder of all of them, sealed backups in the object store, and a rehearsed restoration. Until that ceremony has been rehearsed, the platform cannot honestly claim it can recover.

Exit criteria: a workload gets an identity it never stored, reads a database it has no password for, and every step is audited.

Phase 7 - Observability

elementrole
ClickHousesingle columnar store for logs, metrics and traces. Hot NVMe, cold tier to the object store, ClickHouse Keeper for coordination
OpenTelemetry Collectorthe single collection agent. Daemonset per cluster, gateway on Observation
OTel eBPF instrumentationzero-code auto-instrumentation
SigNoz + query-service + Alertmanagerthe console, the query backend, alert routing
Hubble, OpenCost, Blackbox Exporterflow visibility, cost, synthetic availability

One store, one collector. The corpus removed Prometheus, Loki, Tempo, Thanos and the Grafana stack in favour of this. The migration therefore includes a decommission step, and the risk is running both stores for months because the old dashboards still work. Cutover must be dated.

Phase 8 - Migrating off the running mainframe

The current estate maps onto the target as follows. This is the phase with real data at risk, so it is sequenced last for a reason.

todaytargetmigration note
Docker Compose stacksKubernetes workloads under GitOpslift and re-template, not re-architect. The Compose files are the specification
HeadscaleTailscale plus Cluster API networkingHeadscale remains valid for the mesh; it does not need replacing to satisfy the target
PostgreSQL, single instance, one prodg superuserCloudNativePG, per-role credentialsthe largest security win available. Eleven databases on one superuser role is the finding this phase closes
the Neo4j registry graphregistry-projector fed by eventsthe graph moves from batch-collected to event-fed
CaddyIstio ingress plus external-dnskeep Caddy at the boundary if it still earns its place; the mesh does not require its removal
the 20 conformance checksKyverno policies plus the doctor looppolicies belong in the cluster, the doctor loop remains the evidence producer
no resource limits on 40 of 40 containersrequests and limits on every workloadtrivial to add, and required before any tenancy claim

What must not be migrated: the prodg superuser pattern, the unsealed filesystem secrets, and the flat single-trust-domain assumption. Those are the three things the target exists to remove, and carrying any of them forward forfeits the migration.

Open items that block phases

Recorded here because a phase with an unresolved prerequisite is not a plan, it is a hope. Full register in spec-corpus-open-items.md.

itemblocks
The security watch plane's three open tensions have a deadline of "before this document leaves DRAFT"Phase 6 - the layer cannot be built while its own tenancy and fail-closed behaviour are undecided
jwt.md and tenancy.md are referenced as APPROVED but are absent from the available corpusPhase 6 and all tenancy work
The in-cluster DoR and DoD equivalents are both TBCPhase 2 - the projectors have no enforcement target until specified
platform.patch-finder is TBCPhase 4 - emergency lane automation depends on it
Laya and Jev-Omni have no pinned artifact, serving design or admission recordPhase 5 - typed decision engines are unadopted
row 85 of the stack, "Github Copilot SDK", has no description and a ~ sourcePhase 5
vLLM appears twice in the stackPhase 5 - an unmerged edit, not a component

The dependency chain

Phase 0 (pre-sealed bootstrap)
   |
Phase 1 (four clusters via Cluster API)
   |-----------+-----------+
Phase 3       Phase 6     Phase 4
(bus)         (identity)  (supply chain)
   |             |            |
Phase 2 ------+  |            |
(projectors)  |  |            |
   |          |  |            |
Phase 5 ------+--+------------+
(inference and agents)
   |
Phase 7 (observability)
   |
Phase 8 (migrate off the compose estate)

Phase 2 depends on Phase 3, not the reverse. Projectors need events to consume, so the bus lands first. Building projectors against a queue that does not exist is how this migration would waste a month.

Phase 8 is last and is the only phase that touches live data. Everything before it can be built alongside the running platform without risk.

What this plan does not solve

  1. The corpus is incomplete here. Stack.md references 40 source documents and none are present on this machine. The plan is derived from the eleven documents available and the directives given.
  2. The two APPROVED security documents that are missing (jwt.md, tenancy.md) are the ones that govern Phase 6 and the tenancy model. Their absence is the single largest gap.
  3. No effort estimates. Deliberately. The corpus has an estimate model with an estimator role and a variance record, and inventing numbers outside it would produce figures that look authoritative and are not.
  4. The typed decision engine question stays open. Laya and Jev-Omni are candidates, not components, and the plan does not assume either.