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".
| phase | state | evidence, or what blocks it |
|---|---|---|
| 0 - pre-sealed bootstrap cluster | BUILT | A 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 fabric | BUILT | Cluster 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 projectors | BLOCKED | Depends on Phase 3: projectors need events to consume |
| 3 - the event backbone | BLOCKED | Redpanda 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 pipelines | STARTED | Tekton 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 surfaces | NOT STARTED | Needs GPU capacity the substrate does not have; KubeAI/vLLM cannot be honestly claimed without it |
| 6 - identity and the hardened plane | STARTED | The Security cluster carries cert-manager and Kyverno plus the mainframe-baseline ClusterPolicy (audit). SPIRE, Keycloak, OpenBao and Falco are not in yet |
| 7 - observability | NOT STARTED | ClickHouse, the OTel collector and SigNoz are unbuilt |
| 8 - migrating off the running mainframe | NOT STARTED | CloudNativePG - 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
- 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. - The upstream kindnet manifest carries a placeholder (
${DOCKER_POD_CIDRS}) that CAPD normally substitutes. Applied verbatim,kindnetdpanics and pods lose all egress. The placeholder is resolved per cluster. ClusterResourceSetwithApplyOncenever re-applies a corrected resource - the fix isstrategy: Reconcileplus a fresh binding.- 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.
- 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 mainframe | The specified target | |
|---|---|---|
| Where | stack.md, definition-of-ready/done.md and the security viewpoint | the deployed VPS, Talos, 40 containers |
| Shape | Kubernetes, four clusters, Redpanda, CQRS, Tekton, SPIRE | Docker Compose, Headscale, a registry graph |
| Status | normative and under REVIEW | live 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:
| layer | authority over | fixing phase | Mainframe state today |
|---|---|---|---|
| Server-Side Apply | cluster state | Phase 1 | a cluster with no reconciler |
| Self-Sovereign Architecture | external dependencies | Phase 5 | mostly sovereign, one undeclared exception (LiteLLM to OpenRouter) |
| Sealed Secrets Authority | key material | Phase 0 and 6 | unsplit 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.
| element | choice |
|---|---|
| Provisioning | Pulumi, so the bootstrap is code and the boundary is auditable |
| Isolation | self-contained. The bootstrap cluster reaches out to build the clusters; nothing reaches in |
| Sealing | sealed 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 it | no 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.
| cluster | purpose | trust level | who has access |
|---|---|---|---|
| Inference | vLLM under KubeAI, LangFuse, Llama Guard 3, LLM Guard, NVIDIA GPU Operator | moderate | platform engineers |
| Agents | agent runtime, the fourteen MCP servers, MCP Guard, gVisor-isolated node pool | lowest - assumed compromised | platform engineers |
| Security | SPIRE, Keycloak, OpenBao, cert-manager, Fulcio, Rekor, Falco | highest | no human, GitOps only |
| Databases | CloudNativePG, MongoDB (Percona), Neo4j, OpenSearch, pgvector, Redis | high | DBAs via GitOps |
Three properties are load-bearing and must survive every later phase:
- No human has direct access to the production Security cluster. If an operator can
kubectl execinto SPIRE, the trust root is a person away from compromise. - The Agents cluster is assumed hostile. gVisor isolation, risk-segmented egress, MCP Guard on every MCP call. Agent fallibility is designed for, not denied.
- 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.
| source | projector | read model |
|---|---|---|
stack.md | stack-projector | MongoDB - current component inventory, queryable by type, cluster and owner |
definition-of-ready.md | dor-projector | PostgreSQL - the gate criteria as rows, so a checker evaluates rather than parses |
definition-of-done.md | dod-projector | PostgreSQL - DoD criteria and the acceptance gate |
| the security viewpoint | security-projector | MongoDB - controls, residual risks, opened tensions |
| the platform registries | registry-projector | Neo4j - 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.
| stage | components |
|---|---|
| Build | Tekton, Tekton Chains |
| Prove | Syft (SBOM), Grype, Trivy, Trivy Operator |
| Sign | Fulcio, Rekor |
| Gate | SonarQube, Microcks, Kyverno image-signature validation |
| Update | Renovate |
| Dispatch | Pipeline 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
| element | role |
|---|---|
| KubeAI | control plane for vLLM serving, prefix-aware routing, lifecycle |
| vLLM | the serving backend. PagedAttention, continuous batching, tensor and pipeline parallelism |
| LangFuse | LLM observability, prompt management, evaluation tracing |
| Llama Guard 3 + LLM Guard | content safety gate and input/output scanning proxy |
| PageIndex | hierarchical tree retrieval, vendored, called through LiteLLM |
| Agent Runtime | upstream 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
| layer | components |
|---|---|
| Workload identity | SPIRE (x509-SVIDs, federated across all three substrates), Istio mTLS |
| Human identity | Keycloak (OIDC/OAuth 2.0) |
| Secrets | OpenBao, dynamic credentials, PKI backend |
| Certificates | cert-manager |
| Policy | Kyverno - admission, mutation, image signature |
| Detection | Falco, Tetragon |
| Runtime isolation | gVisor 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
| element | role |
|---|---|
| ClickHouse | single columnar store for logs, metrics and traces. Hot NVMe, cold tier to the object store, ClickHouse Keeper for coordination |
| OpenTelemetry Collector | the single collection agent. Daemonset per cluster, gateway on Observation |
| OTel eBPF instrumentation | zero-code auto-instrumentation |
| SigNoz + query-service + Alertmanager | the console, the query backend, alert routing |
| Hubble, OpenCost, Blackbox Exporter | flow 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.
| today | target | migration note |
|---|---|---|
| Docker Compose stacks | Kubernetes workloads under GitOps | lift and re-template, not re-architect. The Compose files are the specification |
| Headscale | Tailscale plus Cluster API networking | Headscale remains valid for the mesh; it does not need replacing to satisfy the target |
PostgreSQL, single instance, one prodg superuser | CloudNativePG, per-role credentials | the largest security win available. Eleven databases on one superuser role is the finding this phase closes |
| the Neo4j registry graph | registry-projector fed by events | the graph moves from batch-collected to event-fed |
| Caddy | Istio ingress plus external-dns | keep Caddy at the boundary if it still earns its place; the mesh does not require its removal |
| the 20 conformance checks | Kyverno policies plus the doctor loop | policies belong in the cluster, the doctor loop remains the evidence producer |
| no resource limits on 40 of 40 containers | requests and limits on every workload | trivial 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.
| item | blocks |
|---|---|
| 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 corpus | Phase 6 and all tenancy work |
The in-cluster DoR and DoD equivalents are both TBC | Phase 2 - the projectors have no enforcement target until specified |
platform.patch-finder is TBC | Phase 4 - emergency lane automation depends on it |
| Laya and Jev-Omni have no pinned artifact, serving design or admission record | Phase 5 - typed decision engines are unadopted |
row 85 of the stack, "Github Copilot SDK", has no description and a ~ source | Phase 5 |
| vLLM appears twice in the stack | Phase 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
- 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.
- The two
APPROVEDsecurity 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. - 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.
- The typed decision engine question stays open. Laya and Jev-Omni are candidates, not components, and the plan does not assume either.