Skip to content
Skip to Content
How it works

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

PieceWhat it does
kobe-operatorControllers plus the HTTP API. Multi-replica with leader election: only the leader runs controllers; every replica serves the API.
Pool managerIn-process. Decides create / bind / recycle / destroy for each pool.
BackendsProvision a ClusterInstance (k3s, k0s, vcluster, CAPI, vkobe).
Agent SandboxUpstream runtime for SandboxPool when agentSandbox.mode is managed or external.
kobe CLIClient. 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 Pending lease waits in the pool queue until a Ready instance is free. Binding reserves that one instance: the lease and the instance record the same binding, including the lease's cleanupMode. 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 ClusterInstance is 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 ClusterLease is deleted once its instance is gone. A lease with a teardown receipt nobody has consumed yet is kept until it is, and a Quarantined lease stays until cleanup is proven. Terminal SandboxLease records are kept as an audit trail for 168 hours by default (agentSandbox.leaseRetention in the Helm chart, KOBE_SANDBOX_LEASE_RETENTION on 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

BinaryRole
kobe-operatorOperator + HTTP API
kobeCLI
crdgenCRD schema generator (build-time)
kobe-syncPer-cluster runtime for vkobe (on hold)
kobe-host-reaperNode DaemonSet; unmounts stale lease directories
kobe-runnerIn-sandbox supervisor for durable exec and sessions
Available for:
Apple macOS logomacOSMicrosoft Windows logoWindowsLinux logoLinux
Download Kunobi