Operator controls¶
An operator needs to inspect a running kernel and switch its diagnostics on for
a while, and the node needs to flush, drain and rotate a kernel it supervises.
Neither needs to run code in it. The operator lane carries exactly ten
runtime.* commands for this, and the node refuses anything else before it
dials. This page covers the ten commands and their results, the four an
operator reaches through xratu kernel, and how the node carries out an
operator's request.
Who can send what¶
flowchart TB
OP["Operator<br/>xratu kernel ..."]
subgraph CP["CONTROL PLANE"]
direction TB
AD{{"Operator intent admission<br/>4 commands"}}
AS[("kernel.operator.v1 assignment")]
AD --> AS
end
subgraph NODE["NODE"]
direction TB
OC["Operator control route"]
OWN["The node's own lifecycle<br/>flush, drain, identity"]
AL{{"Allowlist<br/>10 runtime.* commands"}}
OC --> AL
OWN --> AL
end
K["Project kernel"]
OP --> AD
AS -->|"pulled"| OC
AL ==>|"OperatorCommand"| K
An operator reaches four commands, through the control plane, which admits
the request and issues an assignment. The node reaches all ten. The run.*
namespace belongs to applications inside the kernel and is refused on this
lane.
The ten commands¶
| Command | Does | Result carries |
|---|---|---|
runtime.ping |
Checks the kernel answers | status |
runtime.health |
Reports startup readiness | startup, runtime_closure_verification (ready, closure_count) |
runtime.status.snapshot |
Reports startup and return-lane position | startup, continuity |
runtime.diagnostics.set |
Enables a diagnostics scope for a time | diagnostics |
runtime.diagnostics.clear |
Disables a diagnostics scope | diagnostics |
runtime.diagnostics.snapshot |
Reports every diagnostics scope | diagnostics |
runtime.flush_evidence |
Pushes pending evidence onto the return lane | status |
runtime.rotate_identity |
Rotates the kernel's workload identity | status |
runtime.drain_prepare |
Stops the kernel admitting new work | status |
runtime.drain_commit |
Completes the drain | status |
The node validates the result before it uses it: runtime.health and
runtime.status.snapshot must carry valid startup evidence, and
runtime.status.snapshot a valid continuity snapshot (kernel.return_continuity.v1:
envelope count, last_acked_seq, terminal_seq, max_seq, and a fault
summary). The drain pair is described on
Two-phase drain.
A command outside the list is refused before any call:
unsupported_on_operator_lane the op starts with run.
unsupported_operator_command any other op outside the ten
Both are final. Any other failure is retried, up to 3 attempts.
What an operator runs¶
PROJECT=support-agent
VERSION=3
xratu kernel status "$PROJECT" "$VERSION"
xratu kernel diagnostics get "$PROJECT" "$VERSION"
xratu kernel trace enable "$PROJECT" "$VERSION" 900
xratu kernel trace disable "$PROJECT" "$VERSION"
xratu kernel captrace enable "$PROJECT" "$VERSION" billing.charge 600
xratu kernel captrace disable "$PROJECT" "$VERSION"
xratu kernel workerlogs enable "$PROJECT" "$VERSION" 300
xratu kernel workerlogs disable "$PROJECT" "$VERSION"
| Command | Sends |
|---|---|
xratu kernel status |
runtime.status.snapshot |
xratu kernel diagnostics get |
runtime.diagnostics.snapshot |
xratu kernel trace, captrace, workerlogs enable |
runtime.diagnostics.set with scope trace, captrace or workerlogs and the TTL in seconds |
xratu kernel trace, captrace, workerlogs disable |
runtime.diagnostics.clear with the scope |
A diagnostics request follows kernel.diagnostics_operator.v1. A set
requires ttl_seconds above 0, and captrace requires a capability token of
letters, digits and _ . : -. The control plane refuses any other command:
How the node carries out the request¶
The control plane issues a kernel.operator.v1 assignment whose task carries
kernel.operator_control.v1, the op, the diagnostics request, and the
runtime's ownership. The node then:
- Reports
ack, andprogresswith phasekernel_operator_dispatchand the op. - Sends the command to the runtime named in the ownership.
- For
runtime.diagnostics.setandruntime.diagnostics.clear, compares the diagnostics state the kernel returned with what was asked: the scope must be enabled after a set and disabled after a clear, and forcaptracethe capability must be listed. A mismatch completes the assignment as failed withKERNEL_DIAGNOSTICS_RECONCILE_FAILED. - Drains the runtime's return lane. When the drain fails, the assignment
completes as failed with
KERNEL_OPERATOR_RETURN_REQUIRED. - Completes as succeeded, with the kernel's response, the continuity outcome
and the diagnostics reconciliation in
result.
The diagnostics state in the result shows each scope's enabled and
expires_at, and for captrace the list of capabilities. A scope set with a
TTL turns itself off at expires_at.