Apply ordering¶
apply runs a fixed sequence. Each step is a precondition for the next, and a
failure stops the run at that point rather than continuing.
flowchart TB
V["1. Validate bundle and arguments"] --> P["2. Confirm the pool exists"]
P --> T["3. Terraform apply"]
T --> SA["4. Service accounts"]
SA --> WI["5. SPIRE workload identity"]
WI --> PA["6. Project runtime authority"]
PA --> FB["7. Managed private fabric"]
FB --> SC["8. Scheduler capability sync"]
SC --> EN["9. Mint and inject enrollment tokens"]
EN --> RT["10. Runtime workload"]
RT --> SS["11. Scale to dp_count"]
The sequence¶
| Step | What it does | Reaches |
|---|---|---|
| 1 | Validates the bundle and checks the organization, pool and dp_install match it |
Local |
| 2 | Confirms the pool exists in the organization | Control plane |
| 3 | Runs Terraform in the bundle's terraform directory |
Your cloud |
| 4 | Applies the service accounts | Your cluster |
| 5 | Applies the SPIRE workload identity entries | Your cluster |
| 6 | Applies the project runtime authority | Your cluster |
| 7 | Applies the managed private fabric | Your cluster |
| 8 | Records the node's scheduler capability | Control plane |
| 9 | Mints one invitation per node label and applies the enrollment secret | Control plane, then your cluster |
| 10 | Applies the xratud workload |
Your cluster |
| 11 | Scales the workload to dp_count |
Your cluster |
Why this order¶
Cloud before cluster. Terraform creates the identities the service accounts annotate. Running it first means a cloud failure leaves the cluster untouched.
Identity before authority. Service accounts exist, then become attestable through SPIRE, then are granted what they may do in project runtime namespaces.
Capability before enrollment. The scheduler capability is recorded before the node joins, so placement can see the node as soon as it is there. Placement is control-plane-derived and data-plane-executed, and this step is where the control plane learns what the node can host.
Tokens before the workload. Step 9 mints an invitation per node label and applies the enrollment secret. Step 10 starts the workload. A node reads its invitation on first start, so the secret has to exist before the pod does.
Scale last. The workload is applied at its baseline and then scaled, so every replica starts into a cluster where identity, authority, fabric and tokens are already in place.
Auto-enrollment is the default¶
Step 9 is why a normal install needs no manual invitation handling: the contract
mints the tokens, binds them to the node labels derived from dp_install, and
injects them as a secret. Minting by hand is the fallback for nodes outside this
flow. See Invitations.
What apply reports¶
The payload accumulates one result per step, so the output is a record of how far it got and what each step did:
{
"status": "applied",
"operation": "apply",
"organization_name": "acme",
"dataplane_pool": "edge-eu",
"dp_install": "dp-eu-west1",
"dp_count": 1,
"provider": "gcp",
"output_dir": "install/dp-eu-west1",
"apply_mode": "auto_enrollment",
"terraform_apply": { "...": "..." },
"serviceaccounts_apply_state": "applied",
"serviceaccounts_manifest_path": "install/dp-eu-west1/k8s/serviceaccounts.yaml",
"spire_workload_identity_apply_state": "applied",
"project_runtime_authority_apply_state": "applied",
"fabric_apply_state": "applied",
"runtime_apply_state": "applied",
"tenant_scope": "6f2a7c3e-1b54-4a29-9f0d-7c83b1e5a412",
"enrollment_state": "auto_enrolled"
}
Each manifest reports both its apply state and the path it was read from, which
is how you confirm that the file apply used is the one you edited.
Reading a failure¶
The step that failed names itself.
| Failure | Stopped at |
|---|---|
... does not match prepared install bundle spec |
Step 1, before anything ran |
| A pool resolution error | Step 2 |
dataplane install terraform command failed (...) |
Step 3, cluster untouched |
dataplane install kubectl apply failed: ... |
One of steps 4 to 7, or 10 |
| An invitation reason code | Step 9. See Mint an invitation and enrollment token |
Because the sequence stops rather than continuing, a partial apply is
re-runnable: fix the cause and run apply again, and the steps that already
succeeded converge rather than conflicting.