Enrollment runtime and identity state¶
A node runs enrollment in one container and runs as itself in another, and the
two share one directory. The init container writes the seed and the identity
state; xratud reads and checks both on every start before it builds anything.
This page is what each side writes, what each side checks, and the refusal that
names a failed check.
For the enrollment record the control plane keeps, and its lifecycle, see Enrollment.
The node's enrollment¶
flowchart TB
CP["Control plane<br/>enrollment exchange,<br/>discovery"]
subgraph POD["THE NODE'S POD"]
direction LR
INIT["Init container<br/>enrollment exchange"]
XD["xratud<br/>seed validation at start"]
end
subgraph VOL["/var/lib/xratu/identity"]
direction LR
SEED[("xratud.bootstrap.json<br/>the seed")]
IDS[("xratud.identity.json<br/>identity state")]
end
CP <-->|"exchange"| INIT
CP <-->|"discovery"| XD
INIT -->|"writes"| SEED
INIT -->|"writes"| IDS
XD -.->|"reads, validates"| SEED
XD -.->|"continuity check"| IDS
The two files have one writer, the init container, and one reader after that,
xratud. Every check xratud makes at start compares the seed against the
identity state or against the control plane's discovery answer, so a start that
fails names which of the two disagreed.
What the init container does¶
The init container reads the invitation code from a file mounted from the node's enrollment secret and the node label from the pod, typically the StatefulSet pod name. It then takes one of two paths.
A valid seed is already on disk. The seed is parsed, its required fields are checked, and its identities are compared with the identity state. When all of that holds, the container writes the seed back with the current control-plane endpoint, records the identity state, and exits without calling the control plane:
{
"status": "joined_cached",
"seed_file": "/var/lib/xratu/identity/xratud.bootstrap.json",
"actor_id": "<dataplane actor>",
"control_plane_base_url": "https://control-plane.example.internal"
}
No seed is on disk. The container resolves the installation identity,
creating one if the identity state has none, waits for the control plane's
readiness endpoint, and posts the exchange. The response's seed is validated,
written, and recorded, and the container reports "status": "joined".
The readiness wait is bounded. Its timeout is between 30 and 7200 seconds and its interval between 1 and 60 seconds; a control plane that is still not ready at the timeout fails the container. The runtime credential the exchange requests has a lifetime between 300 and 7200 seconds, 900 by default.
The seed¶
The seed must carry these fields, and a seed missing one is refused by the container that finds it:
actor_id, auth_token, control_plane_base_url
dataplane_uuid, dataplane_installation_uuid, dataplane_instance_uuid, enrollment_uuid
discovery.dataplane_product_version
discovery.transport_protocol_version, discovery.assignment_schema_version
discovery.credential_issuer_contract_version
discovery.trust_anchor_source
discovery.active_trust_bundle_revision, discovery.active_trust_bundle_digest
discovery.cp_instance_uuid, discovery.cp_identity_revision
discovery.tenancy_policy_revision, discovery.tenancy_policy_source_spec_digest
xratud additionally requires the discovery block's quota fields,
max_tenants, max_active_dataplanes_per_tenant and
max_active_runtime_instances_per_dataplane, and a trust_anchor_source from
the approved set:
The identity state¶
The identity state is a separate document, xratud.enrollment_identity_state.v1,
that holds the identities the seed was issued against:
| Field | Source |
|---|---|
dataplane_installation_uuid |
Created on the node before the first exchange |
dataplane_uuid |
The seed |
dataplane_instance_uuid |
The seed |
enrollment_uuid |
The seed |
cp_instance_uuid |
The seed's discovery block |
cp_identity_revision |
The seed's discovery block |
updated_at_epoch_ms |
The time of the last write |
A new installation identity has the form dpi-<32 hex>. It is written to the
identity state before the exchange, so the value the control plane receives is
already durable when the control plane reuses identity against it.
Every write goes to a temporary file that is flushed to disk and then renamed over the original, so a node that loses power during a write reads either the previous identity state or the new one.
The continuity check¶
A seed is accepted against the identity state only when every identity both of them hold is equal:
A node with no identity state yet accepts the seed alone. A disagreement is
refused with ENROLLMENT_IDENTITY_STATE_MISMATCH, naming the field:
That message on a node means the seed on its volume was issued to a different installation, or by a different control plane identity, than the one the node recorded. See Re-enrollment idempotency for what a node does about it.
What xratud refuses at start¶
| Reason | Condition |
|---|---|
ENROLLMENT_RUNTIME_SEED_INVALID |
The seed is unreadable, not an object, missing a required field, or fails the continuity check |
ENROLLMENT_RUNTIME_DISCOVERY_REQUIRED |
The seed carries no trust_anchor_source |
ENROLLMENT_RUNTIME_TRUST_ANCHOR_MISSING |
The trust_anchor_source is outside the approved set |
After the seed passes, xratud asks the control plane for its discovery
contract and checks the answer against the seed. See
Bootstrap identity reference validation.