This document serves as the official blueprint for the “10x” architectural refactoring of the internal Cloud Infrastructure Hub. It details the migration of our edge-deployed K3s control plane to integrate Agent Substrate and Google AX (Agent Executor), achieving massive scalability, strict tenant isolation via gVisor, and zero-loss execution recovery.
At our current operational scale, the lightweight edge-native K3s cluster experiences control-plane congestion during heavy developer onboarding, multiple Crossplane provider bootstrappings, and rapid multi-agent executions.
To overcome these latency and security bottlenecks, we are refactoring our core orchestration architecture around three engineering objectives:
runsc) with sub-millisecond execution multiplexing.The refactored system splits responsibilities into three major layers: the Visual Agentic Cockpit (Backstage), the Distributed Execution Control Plane (Google AX), and the High-Density Sandbox Substrate (Agent Substrate).
+-----------------------------------------------------------------------+
| 1. Visual Agentic Cockpit (Backstage) |
| - React Component Plugins - MCP Client Sessions (SSE/WS) |
+--------------------------------------------------+--------------------+
| (MCP Stream)
v
+--------------------------------------------------+--------------------+
| 2. Distributed Execution Control Plane (Google AX) |
| - Single-Writer Log Controller - Active Lease Manager (etcd) |
| - Durability Engine (State Logs) - Tekton/Crossplane State Sync |
+--------------------------------------------------+--------------------+
| (Teleport Session)
v
+--------------------------------------------------+--------------------+
| 3. High-Density Sandbox Substrate (Agent Substrate) |
| - Warm Worker Pod Pool - Instant Session Teleport |
| - gVisor (runsc) Sandbox Boundary - Local Temp FS Snapshotting |
+--------------------------------------------------+--------------------+
| (Reconciliation)
v
+-----------------------------------------------------------------------+
| 4. Infrastructure Control Plane (Crossplane) |
| - Unified Declarative API (KRM) - Cloud Resource Providers |
+-----------------------------------------------------------------------+
Traditional Kubernetes control loops rely heavily on persistent CRD polling and etcd writes, causing etcd write locks and API throttling under high frequency.
To maintain a small RAM/CPU footprint on edge hardware (such as Raspberry Pi 5), Substrate does not allocate a dedicated K3s Pod per agent session.
runsc)Because agents and Crossplane providers execute untrusted code or manage sensitive cloud credentials, they must be rigorously isolated from the host operating system.
gvisor runtime class. The container uses runsc to intercept all system calls.runsc handles filesystem, networking, and memory allocation. It blocks critical operations (like loading kernel modules or editing host interfaces) entirely, preventing container escapes.To avoid standard pod cold-starts, Substrate utilizes high-speed memory and filesystem snapshots:
Google AX runs as our primary state-transition supervisor, ensuring that long-running developer pipelines (Tekton) and infrastructure operations are fully durable.
sequenceDiagram
autonumber
actor Dev as Developer (Backstage UI)
participant Backstage as Backstage React Plugin
participant AX as Google AX Controller (Single-Writer)
participant Substrate as Agent Substrate Scheduler
participant Worker as Warm Worker Pod (gVisor)
participant Crossplane as Crossplane Control Plane
participant Cloud as Cloud Provider (GCP)
Dev->>Backstage: Click "Provision App Workspace"
Note over Backstage, AX: Persistent MCP Connection (SSE / WebSockets)
Backstage->>AX: Invoke MCP Tool: 'CreateWorkspace' (Payload: Composition Config)
rect rgb(240, 248, 255)
Note over AX: Single-Writer Controller Log
AX->>AX: Write 'WorkspaceProvision_Started' to Durable Event Log
end
AX->>Substrate: Schedule Isolated Actor (Polecat)
rect rgb(230, 245, 230)
Note over Substrate, Worker: Sub-second Suspend/Resume
Substrate->>Worker: Teleport In-Memory Snapshot (Instant Session Teleport)
end
Note over Worker: gVisor (runsc) Sandbox Boundary
Worker->>Crossplane: Apply Declarative Manifest (XAgentWorkspace CRD)
Crossplane->>Cloud: Provision Infrastructure (Virtual Machine, Database)
Cloud-->>Crossplane: Resource Ready Signal
Crossplane-->>Worker: Update KRM status (Ready)
rect rgb(240, 248, 255)
Note over AX: Durable State Commit
Worker->>AX: Commit Trajectory State (Success)
AX->>AX: Write 'WorkspaceProvision_Completed' to Durable Event Log
end
AX-->>Backstage: Stream KRM state transition over MCP
Backstage-->>Dev: Display active success states & dynamic UI update
Our Backstage developer portal undergoes a complete paradigm shift, evolving from a static catalog into an active agentic cockpit.
Instead of forcing the Backstage UI to repeatedly query the K3s API server for agent states—which causes API throttling and high CPU overhead—we decouple communications using the Model Context Protocol (MCP):
StartAgent, HibernateAgent, AuditWorkspace) and resources (live trajectory events and state streams).runsc) across all K3s master and worker nodes (sweetsixty6, raspberry, rpj, rpi).RuntimeClass resource named gvisor using the runsc handler.setup-gvisor-node.sh.