Skip to content

Architecture

Susant Sahani edited this page Oct 18, 2026 · 1 revision

Architecture

Kryton splits at the provider boundary: callers see one machine API; each provider implements the Go provider.Provider interface (internal/provider) and translates it to its backend.

flowchart TD
  C[Portals, CI, krytonctl, operator console] -->|REST + CloudEvents| A[krytond API]
  A --> P{provider.Provider}
  P --> D[demo: in-memory]
  P --> K[dockur: compose + dockur/windows]
  P --> L[libvirt: virsh, qemu-img]
  P --> V[kubevirt: Kubernetes REST + CDI]
  A --> E[events: history, SSE, webhook]
  A --> R[TTL reconciler]
Loading

Components

  • cmd/krytond: the daemon (API, embedded React operator console, reconciler, event bus).
  • cmd/krytonctl: CLI. cmd/kryton-image: Linux image acquisition and export.
  • Packages under internal/: api, auth, catalog, config, demo, dockur, libvirt, kubevirt, kubeapi, doctor, events, jobs, reconciler, storage, images, golden, atlas, and others.

Behavior documented in docs/ARCHITECTURE.md

  • Identity: every machine gets a UUID independent of the provider's name; on KubeVirt it is recorded in labels plus an annotation holding the original spec.
  • Source of truth: demo = in-memory map (lost on restart); dockur = compose state under KRYTON_DOCKUR_DATA_DIR; libvirt = domains plus metadata under KRYTON_LIBVIRT_DATA_DIR; kubevirt = the Kubernetes API.
  • Projects: namespace per project on KubeVirt; roles viewer/operator/admin intersect with project membership.
  • Events: CloudEvents envelope; history, SSE stream, optional webhook.
  • Single replica: run one krytond. The TTL reconciler has no leader election and the event bus is in-process.
  • Console tickets (v1.3.0): signed 10-minute tickets let iframes/websockets reach a machine console under API-key auth.
  • Security: no raw QEMU, RDP, WinRM or PowerShell exposure through the API.
  • libvirt does not offer snapshots or a graphical console; virsh console works.

Clone this wiki locally