Add Deployments
Add a Deployment, one Service in one Environment on one Deployment Target, so readers find where the Service runs and its URL there.
Before you start
Section titled “Before you start”- The Service is in the Model. See Add a Service.
- The Environment is defined in
workspace.yaml. Every Project shares it, so agree on a new one with the other Teams first. Seeenvironments.
1. Declare the Deployment Targets
Section titled “1. Declare the Deployment Targets”Under targets, declare where Services run, nested as they nest. A platform Team usually declares the shared ones:
targets: aws-eu-west-2: name: AWS eu-west-2 (London) kind: region targets: eks-prod: name: EKS prod kind: eks eks-staging: name: EKS staging kind: eks msk-prod: name: MSK prod kind: msk london-dc: name: London data center kind: dc owner: core-banking targets: zos-prod: name: z/OS production LPAR kind: lpar zos-test: name: z/OS test LPAR kind: lparOther Projects use a Deployment Target by its Qualified id, as platform:eks-prod. Every field is in the targets reference.
2. Add the Deployments
Section titled “2. Add the Deployments”Under deployments, add one entry per Service, Environment and Target, with its url:
deployments: - service: email-system environment: prod target: eks-prod url: https://mail.bigbank.example - service: kafka environment: prod target: msk-prod endpoints: - name: bootstrap url: https://kafka.bigbank.example:9094 - service: kafka environment: staging target: eks-stagingA Service that serves no HTTP, such as a database, has no url. The other fields, such as endpoints, are in the deployments reference.
3. Check the Workspace
Section titled “3. Check the Workspace”archidocs check0 errors, 0 warningsCheck it worked
Section titled “Check it worked”Run archidocs dev, select the Service and use Where is it deployed?. Or open the Environment’s Deployment View, such as deployment/prod.
If it didn’t
Section titled “If it didn’t”check catches an environment that workspace.yaml doesn’t define:
targets: eu-west-1: name: EU West 1 kind: regiondeployments: - service: web environment: production target: eu-west-1 url: https://shop.example.comarchidocs/shop/deployments.yaml:7:18 error unknown-environment Unknown Environment "production"; did you mean "prod"?
1 error, 0 warnings
Rule docs: unknown-environment https://archidocs.dev/docs/reference/rules/unknown-environment/That is unknown-environment: use the name it suggests.
check reports unknown-target when target names no Deployment Target. Check the Qualified id.
With an agent
Section titled “With an agent”upsert_target and upsert_deployment write them. upsert_environment adds an Environment.
Related
Section titled “Related”Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.