1 Deployment definition
A deployment specifies how artifacts are instantiated and configurated in a target environment. It binds concrete implementations to interfaces and provides deployment-specific configuration and resources.
Deployments are defined using the deployment keyword and the type alias definition is as follows:
alias deployment struct {
name string
artifact any
resilience? number
scale ScaleSpec
config? struct open[]
resource? struct open[Resource]
meta? struct open[]
}
alias ScaleSpec struct open[] | number
Unlike component and services, deployment definitions are not followed by an identifier. Instead, the deployment name is specified within the name field of the deployment structure. A deployment is constructed with the following fields:
name: A string that specifies the name of the deployment.artifact: An artifact (component or service) that is being deployed.scale(optional): A scale specification that indicates how many instances of each role defined in the artifact should be created. This can either be a number (which can only be used if the artifact is a component) or a structure that maps role names to their respective instance counts. If not provided, the default is to create one instance per role or component.resilience(optional): A number that indicates the amount of independent failures the deployment should be able to whithstand.config(optional): A configuration block that provides deployment-specific configuration values. It must match the ones declared in the artifact’s interface (or implementation, remember that both are merged)resource(optional): A resource block that provides deployment-specific resource definitions. It must match the ones declared in the artifact’s interface (or implementation, remember that both are merged).
[!NOTE] The
metafield can contain arbitrary amounts of information that is made available to deployments that link to this deployment, be it within the same solution or from some other solution.
Here is an example of a deployment definition:
deployment {
name "ProductionDeployment"
artifact service.WebAppService
resilience 2
scale {
WebAppService 5
}
config {
database_url "postgres://prod-db:5432/webapp"
cache_size 1024
}
resource {
port kumori.Port(80)
volumeOne kumori.Persisted(100G)
}
}