Documentation
¶
Overview ¶
Package warmpool drives the official agents.x-k8s.io SandboxWarmPool CRD onto the L3 node-local warm pools. It is the control-plane surface for warm capacity: `kubectl apply` a SandboxWarmPool sets the target, editing spec.replicas scales it, deleting it drains — no SSH, no per-node poking.
The design contract the whole L3 stack depends on: this reconcile is POOL-LEVEL, O(pools + nodes), NEVER O(sandboxes). It runs inside the aggregated apiserver process alongside the NodeInventory cache, so one component polls node state and writes back CR status. There is deliberately NO per-sandbox reconcile — individual Sandbox status is synthesized on read from NodeInventory, so the apiserver never carries a per-sandbox background load and cannot wedge as the sandbox count grows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientFactory func(addr, token string) PoolSetter
ClientFactory builds a PoolSetter for one node's advertise address and the uniform fleet api_token.
func NewSandboxdFactory ¶
func NewSandboxdFactory() ClientFactory
NewSandboxdFactory returns the production factory backed by the real HTTP client.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver reconciles SandboxWarmPool CRs into node-local sandboxd warm targets.
func New ¶
func New(kube client.Client, inv scale.InventorySource, token string, factory ClientFactory, opts Options) *Driver
New builds a Driver. token empty leaves the driver fail-closed (it logs and sets no pools rather than driving sandboxd unauthenticated).
func (*Driver) Reconcile ¶
Reconcile runs a full pool reconcile on ANY SandboxWarmPool or NodeInventory event — so a `kubectl apply/patch/delete` reacts in milliseconds, not after a poll tick. It ignores the request key (the loop is global, O(pools+nodes)) and requeues after d.interval, which doubles as the sampling period of the warm count written back to status. Target changes therefore land in milliseconds (event-driven), while the fill they kick off — the node side provisions at O(100)/s per node — becomes visible one interval at a time.
func (*Driver) SetupWithManager ¶
SetupWithManager registers the driver as a controller watching SandboxWarmPool (the desired-state object) and NodeInventory (the node set to spread across). It uses the manager's cached client for pool/template reads and status writes.