Skip to main content

SubState

You can require other Statefiles in your Statefile using the SubStates key.

This is useful if you need to reuse a statefile in multiple places.
Or in a mono-repository settings to have a single source of truth for your state.

There is an example of how to use it:

ApiVersion: v0.18

Namespace: global

SubStates:
# You can require substates from remote urls
- https://my-domain/remote-statefile.yml
# Or from local files
- ./sub_child.yml
# If your substate have arguments, you can pass them like this
- Path: ./sub_child.yml
Args:
- Name: my-arg
Value: my-value

Cargoes:
- Name: my-cargo
Containers:
- Name: web
Image: ghcr.io/next-hat/nanocl-get-started:latest

Resources:
- Name: deploy-example.com
Kind: ncproxy.io/rule/v0.15
Data:
Rules:
- Domain: deploy-example.com
Network: All
Locations:
- Path: /
Target:
Key: global.my-cargo.c
Port: 9000