Component Dependencies
Component dependencies allow you to create dependencies between components, and model your app as a graph.
Declare dependencies between components to control the order that installs provision/deprovision the parts of your app.
Why Dependencies?
Most applications have either explicit, or implicit dependencies between the different components that comprise them.
For example, given an app that comprises a Helm chart component and a Terraform component:
In this example, the helm
chart requires that the database be provisioned before it is deployed. Otherwise, the
database will not exist yet, and the database_url
output will not be defined.
When deprovisioning the install, the helm
chart must be deprovisioned before the database, to ensure no active
dependencies exist, preventing the database from being shut down.
Defining Component Dependencies
To define a component dependency, add a dependencies
field in the component config, that references the parent
component it depends on.
To define a dependency:
Nuon automatically checks for cycles, and will error when trying to update a component config to contain a dependency cycle.
Install Provisioning
When an install is provisioned, Nuon will generate a graph of the app based on the defined dependencies. Nuon will automatically deploy the latest build of each component to the install. In the previous example, this means that the database component would be deployed before the Helm chart.
For example, when you create a new install, each component will automatically be deployed:
To check the status of each component on the install:
Install Deprovisioning
When an install is deprovisioned, Nuon will generate a graph of all the deployed components on the install, and walk them in reverse, to deprovision them properly. In the previous example, this means the helm component would be deprovisioned before the database.