How devincd/agents works
OpenKruise Agents manages AI-agent sandboxes on Kubernetes, offering Kubernetes CRDs and E2B-compatible APIs. A user requests a sandbox through the E2B API; the manager translates requests into sandbox operations, while Kubernetes controllers reconcile sandbox workloads and related resources. Gateway components handle sandbox routing and authentication. Separate controller capabilities cover claims, sets, autoscaling, updates, checkpoints, and commits. The graph uses README statements and SOURCE INDEX references for documented or visible links; unsampled components are represented by their listed source paths, with uncertain wiring omitted.
Main entry points: main.go Sandbox gateway · gateway_controller.go Route controller · registry.go Route registry · poolautoscaler_controller.go Pool autoscaler
Components 23
API and management
- E2B API
pkg/servers/e2b/routes.go - Sandbox manager
cmd/sandbox-manager/main.go - Sandbox infrastructure
pkg/sandbox-manager/infra/sandboxcr/infra.go - Kubernetes APIs
api/v1alpha1/sandbox_types.go
Sandbox lifecycle
- Sandbox controller
pkg/controller/sandbox/sandbox_controller.go - Sandbox claims
pkg/controller/sandboxclaim/sandboxclaim_controller.go - Sandbox sets
pkg/controller/sandboxset/sandboxset_controller.go - Pool autoscaler
pkg/controller/poolautoscaler/poolautoscaler_controller.go - Update operations
pkg/controller/sandboxupdateops/sandboxupdateops_controller.go - Token refresh
pkg/controller/securitytokenrefresh/token_refresh_controller.go - Admission webhooks
pkg/webhook/server.go
Gateway and routing
- Sandbox gateway
cmd/sandbox-gateway/main.go - Route controller
pkg/sandbox-gateway/controller/gateway_controller.go - Route registry
pkg/sandbox-gateway/registry/registry.go - JWT authentication
pkg/sandbox-gateway/jwtauth/manager.go - Traffic proxy
pkg/proxy/server.go - Peer route refresh
pkg/sandboxroute/refresh/handler.go
Checkpoint and storage
- Checkpoint operations
pkg/controller/sandbox/core/checkpoint.go - Sandbox commits
pkg/controller/commit/commit_controller.go - CSI storage mounts
pkg/utils/csiutils/storages_provider.go - Storage runtime
pkg/agent-runtime/storage-cli/main.go
Other components
- Sandbox user
- Kubernetes
Connections 24
- Sandbox user → E2B API: requests sandbox
README.md - E2B API → Sandbox manager: calls management
- Sandbox manager → Sandbox infrastructure: uses infrastructure
cmd/sandbox-manager/main.go - Sandbox infrastructure → Kubernetes APIs: manages resources
- Kubernetes → Sandbox controller: triggers reconciliation
- Sandbox controller → Kubernetes: reads and patches
pkg/controller/sandbox/sandbox_controller.go - Sandbox claims → Kubernetes: reconciles claims
pkg/controller/sandboxclaim/sandboxclaim_controller.go - Sandbox sets → Kubernetes: reconciles sets
pkg/controller/sandboxset/sandboxset_controller.go - Pool autoscaler → Sandbox sets: scales target
pkg/controller/poolautoscaler/poolautoscaler_controller.go - Pool autoscaler → Kubernetes: reads resources
pkg/controller/poolautoscaler/poolautoscaler_controller.go - Update operations → Kubernetes: reconciles updates
pkg/controller/sandboxupdateops/sandboxupdateops_controller.go - Token refresh → Kubernetes: watches resources
pkg/controller/securitytokenrefresh/token_refresh_controller.go - Admission webhooks → Kubernetes: serves admission
pkg/webhook/server.go - Sandbox gateway → Route controller: starts route feed
cmd/sandbox-gateway/main.go - Sandbox gateway → JWT authentication: configures authentication
cmd/sandbox-gateway/main.go - Sandbox gateway → Route registry: gets registry
cmd/sandbox-gateway/main.go - Route controller → Route registry: updates routes
pkg/sandbox-gateway/controller/gateway_controller.go - Route controller → Kubernetes: watches sandboxes
pkg/sandbox-gateway/controller/gateway_controller.go - Traffic proxy → Peer route refresh: serves refresh
pkg/proxy/server.go - Traffic proxy → Route registry: stores routes
- Checkpoint operations → Kubernetes: coordinates checkpoint
- Sandbox commits → Kubernetes: reconciles commits
pkg/controller/commit/commit_controller.go - CSI storage mounts → Kubernetes: reads volumes
pkg/utils/csiutils/storages_provider.go - CSI storage mounts → Storage runtime: selects provider