Wire infrastructure
Add an infrastructure component and pass its output to your workload
So far you deployed one workload. The thing that makes Admiral different is composing components: an upstream component produces an output, and a downstream component consumes it automatically, in the right order. Here you add an infrastructure component and feed its output into the workload.
1. Register a Terraform agent
Infrastructure components run on a Terraform agent rather than the Kubernetes agent.
admiral agent register --kind terraform --name local-tf
# TODO: run/install the Terraform agent (local process or container)Register a second agent of kind Terraform, then run it where it has what it needs.
2. Add an infrastructure component
# TODO: confirm. Adds an infra change to a new changeset in dev.
admiral changeset create --env demo/dev --name add-config
admiral changeset add-change <changeset> \
--name config \
--kind infrastructure \
--engine terraform \
--target local-tfAdd a change of kind infrastructure, engine terraform, bound to the Terraform agent.
3. Declare the dependency
Make the workload consume the infra component's output. The workload reads it as .component.config.<output>; Admiral defers the workload until the infra component has applied and its output exists. See Variables & Outputs.
# TODO: how a dependency + output reference is expressed on the workload change
# (values template referencing .component.config.<output>).On the workload component, reference the infra component's output in its values; the dependency is recorded automatically.
4. See the dependency graph
admiral env describe demo/devThe environment view renders the graph: config upstream of web.
5. Plan and apply the wavefront
Plan and apply the changeset. The run applies config first, captures its output, renders web against that concrete value, then applies web - one approval, the rest cascades.