Skip to content

The three stages

prepare, apply and up are one contract at three points. You express the installation in flags; prepare renders a bundle from them, apply executes that bundle, and up does both in one call.

The bundle prepare writes is ready to apply as rendered. The flags are the input surface, so what you need is expressed there rather than by changing what came out.

xratu dataplane install prepare acme edge-eu dp-eu-west1
xratu dataplane install apply   acme edge-eu dp-eu-west1
xratu dataplane install up      acme edge-eu dp-eu-west1

What each one does

flowchart LR
  F["Flags or install spec<br/>your requirements"] --> P["prepare<br/>renders a ready bundle"]
  P --> A["apply<br/>terraform, manifests,<br/>enrol, scale"]
  F --> U["up<br/>prepare and apply"]
  U --> A
Stage Reaches Leaves behind
prepare The control plane, to confirm the pool exists A bundle directory of generated files
apply Your cloud and your cluster, and the control plane Provisioned resources, an enrolled node
up Everything prepare and apply reach The same, with no pause between them

prepare

Renders the install bundle and writes it. Before rendering anything it confirms the pool exists in the organization, so a typo in either is caught before files are produced rather than at apply.

It reports what it wrote:

{
  "status": "prepared",
  "operation": "prepare",
  "organization_name": "acme",
  "dataplane_pool": "edge-eu",
  "dp_install": "dp-eu-west1",
  "dp_count": 1,
  "provider": "gcp",
  "spec_file": "install/install.spec.json",
  "install_input_spec_file": "install/install.input.yaml",
  "output_dir": "install",
  "generated_files": { "...": "..." },
  "written_file_count": 9
}

prepare changes nothing in your cloud or your cluster, and running it twice is safe. What it produces is complete: applying it unchanged is the normal path.

apply

Reads the prepared bundle and executes it. Before doing anything it checks that the organization, pool and dp_install you passed match the ones in the bundle:

organization_name does not match prepared install bundle spec
dataplane_pool does not match prepared install bundle spec
dp_install does not match prepared install bundle spec

That check exists because apply takes the same three positional arguments as prepare, and applying one bundle while naming another installation would otherwise provision into the wrong place.

It then runs Terraform, applies the Kubernetes manifests in a fixed order, mints and injects enrollment tokens, applies the runtime workload, and scales it. See Apply ordering.

up

Runs prepare and then apply in one call, passing the prepared bundle straight into apply. It reports both phases:

{
  "status": "up",
  "operation": "up",
  "prepare": { "...": "..." },
  "apply": { "...": "..." }
}

The bundle is still written to disk, so you can read afterwards what was applied. What up removes is the moment between writing and executing. See up as a shortcut.

Which to use

up is the whole path in one call, and it is the normal one. Express the installation in flags or a spec and let it run.

Split into prepare and apply when you want something between them:

  • Reading terraform plan before the cloud layer runs, which is usual where cloud changes need approval.
  • Preparing and applying at different times or by different people.

Reaching into a rendered file works, because apply reads each file from disk as it uses it, but it runs against the grain: the flags and the spec are where requirements belong, and a re-prepare rewrites what you changed. See Editing generated files.

Next