Architecture
kobe is an in-cluster operator with an embedded HTTP API. Callers never talk to Kubernetes as themselves. They authenticate to the API; the operator creates lease objects and binds them to warm capacity.
Components
| Piece | What it does |
|---|---|
kobe-operator | Controllers plus the HTTP API. Multi-replica with leader election: only the leader runs controllers; every replica serves the API. |
| Pool manager | In-process. Decides create / bind / recycle / destroy for each pool. |
| Backends | Provision a ClusterInstance (k3s, k0s, vcluster, CAPI, vkobe). |
| Agent Sandbox | Upstream runtime for SandboxPool when agentSandbox.mode is managed or external. |
kobe CLI | Client. Cluster leases get a kubeconfig; sandboxes get exec / logs / attach / SSH. |
Cluster lease flow
parse request
↓
authenticate (SSH / OIDC / token)
↓
enforce AccessPolicy (pool allowlist, TTL cap, concurrency)
↓
create ClusterLease
↓
bind a Ready ClusterInstance
↓
return kubeconfig with a short-lived client certificate
The pool controller keeps enough ClusterInstance objects to satisfy size or scaling.minReady. The instance controller provisions and health-checks the backend. The lease controller binds, issues kubeconfig, and enforces release and expiry.
Instance and lease move through these phases:
ClusterInstance: Creating → Ready (warm) → Leased → Recycling → deleted, replacement created
↘ Quarantined
ClusterLease: Pending → Bound → Released / Expired → Recycling → deleted
↘ Quarantined
- Binding. A
Pendinglease waits in the pool queue until aReadyinstance is free. Binding reserves that one instance: the lease and the instance record the same binding, including the lease'scleanupMode. Teardown follows the recorded mode, so editing the lease later cannot change how its capacity is cleaned up. - Standard cleanup (the default). On release or expiry the backend deletes the instance's resources, the
ClusterInstanceis deleted, and the pool creates a replacement. - VerifiedDestroy cleanup. Teardown checks each resource recorded in the instance's creation manifest and writes a receipt to the lease. Only k3s supports it; other backends refuse the lease before binding. If absence cannot be proven, the instance and lease move to
Quarantined. A quarantined instance is never rebound and still counts against pool capacity until an operator resolves it. - Retention. A
ClusterLeaseis deleted once its instance is gone. A lease with a teardown receipt nobody has consumed yet is kept until it is, and aQuarantinedlease stays until cleanup is proven. TerminalSandboxLeaserecords are kept as an audit trail for 168 hours by default (agentSandbox.leaseRetentionin the Helm chart,KOBE_SANDBOX_LEASE_RETENTIONon the operator).
An instance whose provisioning or bootstrap fails moves from Creating to Failed and is replaced. See Pool lifecycle for each phase.
Sandbox lease flow
parse request
↓
authenticate and enforce AccessPolicy.sandbox
↓
create SandboxLease
↓
admit against pool quota (ledger)
↓
bind a certified warm Sandbox (or create one)
↓
Ready — exec / logs / attach / port-forward
Callers never send a Pod spec. The SandboxPool template is the whole workload surface. See Sandbox pools.
POST /v1/leases admits either kind from the pool name. Clients do not pick Cluster vs Sandbox URLs. Kind-specific verbs (exec, logs, attach, port-forward, executions) are also served under /v1/leases/:id/….
Backends
The instance controller delegates provisioning to the pool's spec.backend.type. All backends satisfy the same contract — provision, health-check, readiness, recycle — so admission and leases behave the same. See Backends and Runtime strategy.
Development of the in-house kobe-sync sidecar and the vkobe backend is on hold. Existing vkobe pools keep working; prefer vcluster for new density pools.
API bounds
Concurrency is bounded at 200 simultaneous API requests. Infrastructure routes (/healthz, /metrics) are exempt.
Binaries
| Binary | Role |
|---|---|
kobe-operator | Operator + HTTP API |
kobe | CLI |
crdgen | CRD schema generator (build-time) |
kobe-sync | Per-cluster runtime for vkobe (on hold) |
kobe-host-reaper | Node DaemonSet; unmounts stale lease directories |
kobe-runner | In-sandbox supervisor for durable exec and sessions |