Editing generated files¶
Requirements go in the flags or the install spec. That is the input surface, and
the bundle prepare renders from it is ready to apply as it stands.
Editing a rendered file is the fallback for what the input surface does not
carry. It works, because apply reads each file from disk at the moment it uses
it, but it runs backwards: the change sits outside the input that produced the
bundle, and a re-prepare rewrites it.
Forward and backward¶
flowchart LR
F["Flags or install spec"] --> P["prepare"]
P --> B["Bundle, ready"]
B --> A["apply or up"]
B -.->|"fallback"| E["Edit a rendered file"]
E -.-> A
E -.->|"prepare again<br/>rewrites it"| P
The solid path is the one to take. The dotted one exists and is honoured, and it costs you the reproducibility the solid path has.
| Command | Effect on a rendered-file edit |
|---|---|
apply |
Reads and uses it |
apply again |
Reads and uses it again |
prepare |
Overwrites every generated file |
up |
Runs prepare, so overwrites, then applies the fresh output |
Every one of the nine files is rewritten unconditionally on prepare, with no
merge and no preservation of local changes.
Start with the input surface¶
Almost everything is a flag or a spec field. Namespaces, service account names, images, node count, approved runtime namespaces, registry and bucket paths, and every provider value. Set it there and it survives regeneration:
xratu dataplane install prepare acme edge-eu dp-eu-west1 \
--install-spec install/dp-eu-west1/install.input.yaml
Reach for a rendered file only once you have established the input surface does not carry what you need. See Two ways to drive install for the full field set.
Keep the bundle in version control. A change that only the rendered file can
express, such as an organization-specific IAM resource in main.tf, lives as a
diff you re-apply after regenerating. Committing the bundle is what makes that
diff visible.
Or stop re-preparing. A bundle is re-appliable on its own. Once it is
correct, apply converges from it, and prepare is needed again only when an
input changes.
What a rendered-file edit is actually for¶
| File | Edit it to |
|---|---|
terraform/main.tf |
Adjust IAM scope or naming your organization requires |
k8s/serviceaccounts.yaml |
Adjust annotations or add ones your cluster policy expects |
k8s/project-runtime-authority.yaml |
Change what the node may do in project runtime namespaces |
k8s/dataplane.runtime.yaml |
Adjust workload settings such as resources or scheduling |
k8s/spire-workload-identity.yaml, k8s/managed-private-fabric.yaml |
Rendered from architecture-fixed decisions; edit only with a reason |
xratu/dataplane.bootstrap.yaml |
Rendered from the install spec; prefer changing the spec |
The realistic list is short: an organisation-specific IAM resource, a cluster policy annotation, a resource request your platform mandates, and the Azure client-ID substitution. Everything else has a field.
What re-prepare preserves¶
prepare writes the bundle. It does not reach into your cloud or your cluster,
so anything already applied stays applied until the next apply.
That means a regenerate-and-apply cycle converges rather than resetting: the
freshly rendered files are applied over what is running, and Terraform and
kubectl each reconcile to the new content.
Ordering¶
An edit takes effect at the next apply, so make it before one rather than
after. up renders and applies in the same call, which is why an installation
that needs a rendered-file edit is run as prepare then apply. See
up as a shortcut.