This document describes the architecture of the HttpBin MSP example.
flowchart TB
subgraph kcp["kcp (control plane)"]
subgraph provider["Provider Workspace<br/>root:msp:httpbin-provider"]
APIExport["APIExport<br/>api-syncagent"]
end
subgraph consumer["Consumer Workspace<br/>root:msp:customer-a"]
APIBinding["APIBinding<br/>→ api-syncagent"]
HttpBinOrder["HttpBin<br/>httpbin-demo"]
end
end
subgraph kind["kind cluster (service cluster)"]
subgraph kcpsystem["kcp-system namespace"]
SyncAgent["api-syncagent<br/>(deployment)"]
end
subgraph httpbinsystem["httpbin-system namespace"]
Operator["httpbin-operator<br/>(deployment)"]
end
subgraph default["default namespace"]
HttpBinCR["HttpBin CR<br/>(synced)"]
Deploy["Deployment<br/>httpbin-demo"]
Service["Service<br/>httpbin-demo"]
Pod["Pod<br/>kennethreitz/httpbin"]
end
end
%% Relationships
APIBinding -->|binds to| APIExport
HttpBinOrder -->|"sync DOWN"| SyncAgent
SyncAgent -->|creates| HttpBinCR
HttpBinCR -->|watched by| Operator
Operator -->|creates| Deploy
Operator -->|creates| Service
Deploy -->|runs| Pod
Service -->|exposes| Pod
HttpBinCR -->|"sync UP (status)"| SyncAgent
SyncAgent -->|updates| HttpBinOrder
style kcp fill:#e1f5fe
style kind fill:#fff3e0
style HttpBinOrder fill:#c8e6c9
style HttpBinCR fill:#c8e6c9
-
Consumer orders an HttpBin — The consumer creates an
HttpBinCR in their kcp workspace (root:msp:customer-a). -
api-syncagent syncs DOWN — The agent (running in kind) watches the consumer workspace via the
APIBinding. When it sees the newHttpBin, it creates a correspondingHttpBinCR in the kind cluster. -
httpbin-operator provisions resources — The operator (running in kind) watches for
HttpBinCRs. When it sees one, it creates:- A
Deploymentrunning thekennethreitz/httpbincontainer - A
Serviceexposing the deployment
- A
-
Status syncs UP — The operator updates the
HttpBinCR's.status(ready, url). The api-syncagent syncs this status back to the consumer'sHttpBinin kcp. -
Consumer sees ready state — The consumer can now see their HttpBin is ready and get the service URL.
| Component | Location | Purpose |
|---|---|---|
| kcp | Host process | Control plane — hosts workspaces, APIExports, APIBindings |
| api-syncagent | kind / kcp-system | Syncs objects between kcp workspaces and the kind cluster |
| httpbin-operator | kind / httpbin-system | Watches HttpBin CRs, creates Deployments + Services |
| HttpBin CRD | kind | Defines the HttpBin custom resource |
| Aspect | msp-postgres-kcp-only | msp-httpbin-operator |
|---|---|---|
| Backing operator | CloudNativePG (third-party) | Custom httpbin-operator |
| API passthrough | CNPG's native Cluster API |
Custom HttpBin API |
| Related resources | Connection Secret syncs back | No related resources |
| Complexity | Higher (stateful database) | Lower (stateless httpbin) |