Deployment reconciliation¶
A project version is running, stopped or on its way between the two, and the
control plane holds which of those it should be. Each change to that desired
state reaches a node as a project.serve.v1 assignment with a phase: start the
runtime, check it is ready, or remove it. The node converges the cluster to the
phase, reports what it observed, and the control plane moves the version's
status on from the report. This page covers what issues each phase, what the
node does for each, the evidence it returns, and how a superseded version is
removed.
The version's status¶
stateDiagram-v2
[*] --> deploying: deploy, release target, or wake from zero
deploying --> deployed: serve_start succeeded
deploying --> failed: serve_start failed
deployed --> stopping: stop or superseded
deployed --> deleting: delete
stopping --> stopped: serve_stop succeeded
deleting --> stopped: serve_stop succeeded
stopped --> deploying: deploy again
failed --> deploying: deploy again
The control plane writes the desired state and issues the assignment; the
node's report moves the status to deployed, stopped or failed.
Each phase has a convergence limit of 900 seconds in the desired state's
project.serve.convergence_sla.v1.
What issues each phase¶
| Phase | Issued when |
|---|---|
serve_start |
A version is deployed, becomes a release route's target, or is woken from zero replicas by a run |
serve_stop |
A version is stopped, deleted, or superseded under staged cleanup |
The runtime deploy contract also accepts a third phase, readiness_check,
which confirms a deployment against its kernel.
A release route change with mode staged_cleanup converges the new target
with serve_start and queues serve_stop for the version it replaced. See
Versioned release routes and bindings.
What the node does for each phase¶
| Phase | The node | Reports status |
|---|---|---|
serve_start |
Applies the Deployment and the Service | applied |
readiness_check |
Applies both, waits for the rollout, finds the kernel endpoint and completes the handshake | ready or not_ready |
serve_stop |
Deletes the Deployment and the Service | removed |
Every phase is safe to repeat. apply converges the objects to the contract
whatever state they are in, and delete ignores objects that are already gone;
a serve_stop whose namespace no longer exists reports removed. A node that
takes over a deployment from another node, or receives the same phase twice,
therefore converges to the same objects. How the objects are rendered is on
Runtime actuation.
ready requires all three of: ready replicas at least the desired count, a
ready kernel endpoint, and an accepted kernel handshake. not_ready reports
which of the three is missing.
The deploy evidence¶
Each report carries project.runtime_deploy_evidence.v1 as
runtime_deploy in its execution report. For a readiness check:
{
"contract_version": "project.runtime_deploy_evidence.v1",
"required": true,
"phase": "readiness_check",
"status": "not_ready",
"mode": "kubernetes_native",
"namespace": "acme-projects",
"deployment_ref": "support-agent-v3",
"service_ref": "support-agent-v3",
"runtime_image_digest": "sha256:c41d...",
"desired_replicas": 2,
"ready_replicas": 2,
"rollout_ready": true,
"endpoint_ready": true,
"kernel_handshake_ready": false,
"kernel_readiness": {
"handshake_result": "invalid_startup_evidence",
"endpoint_source": "endpointslice",
"selected_pod": "support-agent-v3-7c9f4-2kq8d",
"selected_endpoint": "10.4.2.17:7777"
},
"observed_at_epoch_ms": 1790000000000
}
The evidence also repeats the contract: workspace_uuid, project_name,
version, endpoint, placement, the kernel control service and port, the
image reference, the replica bounds, cooldown_period, target_queue_depth,
resources and rollout, and kernel_readiness carries the full endpoint and
handshake record, trimmed to four fields in the example. Read status first; for not_ready, the three
*_ready flags name the part that is missing, and kernel_readiness names the
pod and the handshake result.
A phase that fails reports status failed with the failure in reason. See
Serve runtime deploy.
Removal¶
serve_stop for a version being stopped or deleted carries a deletion
finalizer in the desired state, with its phase, reason and requester. The
node's successful report sets teardown_confirmed, and the finalizer's state
becomes teardown_confirmed for a stop or finalized for a delete. The
version then reports stopped. A serve_stop for a version with no objects in
the cluster also reports removed.