Deployment identity
Layer 6. Services. Services
A deployment is the running unit. The deployment row has no name of its own (ce ent/schema/deployment.go: stack_name is the stack coordinate). Stack and environment are the axes, with the tenant.
- Tenant (
tenant_name): which tenant the deployment belongs to. - Stack (
stack_name): the name axis. - Environment (
environment): the other axis.
The app is app_name. It is not a second running unit.
shc install takes the app. The stack name defaults to that app name. --stack and --environment (-e) select the axes:
shc install nextcloudshc install nextcloud --stack cloudshc install nextcloud -s cloud -e prodThe same app can run twice when the stack axis differs:
shc install wordpress --stack blogshc install wordpress --stack shopOr when the environment axis differs:
shc install nextcloud -s cloud -e prodshc install nextcloud -s cloud -e stagingEach of those is its own deployment: its own directory, its own volumes, its own config row at deployment scope. Unset environment is default (ce core/scope/scope.go).
Directory
Section titled “Directory”DeploymentDir joins {state_home}/deployments/{tenant}/{stack}/{environment} (ce modules/app/install_runner.go). The deployment’s compose project name is {tenant}_{environment}_{stack} (ce modules/app/install_runner.go, DockerProjectName). A node that runs replica projects runs each replica as its own compose project, {tenant}_{environment}_{stack}-{pod}-r{ordinal}, with -i{n} added for a later incarnation (ce core/pod/record.go, ProjectName); any other node runs the deployment’s own compose.yaml under the deployment’s name. See Replicas and pods. Containers carry shc.tenant, shc.stack and shc.environment either way.