Overview

Components and state model.

Krypton is composed of four binaries:

ComponentRole
ManagerKubernetes operator. Reconciles Agent CRs → Deployments + Services + ServiceAccounts. Runs the scaling decider.
Control planeRead-only HTTP API + the operator UI. Optionally mirrors agents into Postgres for offline querying.
GatewayPublic ingress. Reverse-proxies invocations to the agent’s in-cluster Service.
SidecarPer-pod krypton-proxy. Enforces concurrency, surfaces in-flight count, exposes Prometheus metrics.

High-level diagram

                 ┌─────────────────────────────────────────────────┐
                 │                  Krypton UI (React)             │
                 └────────────────────────┬────────────────────────┘
                                          │ REST
                 ┌────────────────────────▼────────────────────────┐
                 │              Krypton Control Plane              │
                 │     (informer cache + optional Postgres)        │
                 └──────┬─────────────────┬─────────────────┬──────┘
                        │                 │                 │
              ┌─────────▼────────┐   ┌────▼─────┐    ┌──────▼──────┐
   client ───►│ Krypton Gateway  │   │ Manager  │    │   Scaler    │
              │                  │   │ (recon-  │    │  (in mgr)   │
              │                  │   │  ciler)  │    │             │
              └────────┬─────────┘   └────┬─────┘    └──────┬──────┘
                       │                  │                 │
                       │       owns       │     writes      │
                       │                  ▼  status         │
                       │      ┌───────────────────────┐     │
                       └─────►│   Agent pod           │◄────┘
                              │  ┌─────────────────┐  │
                              │  │ krypton-proxy   │  │  ◄── /_krypton/inflight
                              │  │   (sidecar)     │  │
                              │  └────────┬────────┘  │
                              │           ▼           │
                              │   ┌─────────────┐     │
                              │   │ user agent  │     │
                              │   └─────────────┘     │
                              └───────────────────────┘

Where state lives

StateSource of truth
Agent desired specThe Agent CR (Kubernetes etcd)
status.phase, replicasManager writes; readers consume
status.desiredReplicasScaler (in manager)
status.lastInvocationAtGateway writes after each invocation
In-flight countSidecar’s /_krypton/inflight endpoint
Invocation history (later)Postgres

CRDs are the source of truth. Postgres is a write-through mirror — the API serves directly from the informer cache (fresher, no DB hop).

Next

For what each component does, how they’re wired, and the request lifecycle through them, see Components and Request lifecycle.