Skip to content

Deployment Targets and Deployments

targets declares the Deployment Targets Services run on, nested as they nest, and deployments lists each Service in each Environment on a Target, with its URLs. They can sit in any file of a Project; deployments.yaml is a convention.

The Kitchen sink’s: a cluster inside a region, and a Deployment of each Service, the API’s with a health endpoint:

sink/deployments.yaml
targets:
cloud:
name: Cloud region
kind: region
targets:
cluster:
name: Kubernetes cluster
kind: k8s
deployments:
- service: web
environment: prod
target: cluster
url: https://shop.sink.example
- service: api
environment: prod
target: cluster
url: https://api.sink.example
instances: 3
endpoints:
- name: health
url: https://api.sink.example/healthz
- service: orders-db
environment: prod
target: cloud
- service: events
environment: prod
target: cloud
- service: mailer
environment: prod
target: cluster
- service: search
environment: prod
target: cloud

See Add Deployments.

These keys of a Project file declare Deployment Targets and the Deployments on them.

Generated from schemas/model.schema.json, which editors use for completion, validation and these descriptions on hover. In the Field column, <id> stands for a key you choose and [] for each item of a list. A key that isn’t listed here is an error: unknown-field.

In the Type column:

  • id: a lowercase slug of a-z, 0-9 and - that starts with a letter or a digit (^[a-z0-9][a-z0-9-]*$).
  • reference: an id in the same Project, or a Qualified id, project:id, for something in another Project (^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$).
  • URL: a full URL with its scheme, such as https://shop.example.com.
Field Type Required Default Description
targets map of id → Deployment Target Deployment Targets, keyed by id and nested as they nest. Their ids share the Project’s ids with its Elements.
targets.<id> Deployment Target A Deployment Target: a place Services run, such as a region, a cluster in it or a platform. Deployment Targets nest to any depth and are not Elements.
targets.<id>.name string yes The Deployment Target’s display name.
targets.<id>.kind string yes What the Deployment Target is, in a short word you choose, printed as written in its header: prefer short forms such as region, az, vnet, snet, vm, aks, ns or asp over long names like availability-zone or subnet.
targets.<id>.description string What the Deployment Target is, in a sentence or two.
targets.<id>.owner id the Project’s owner The Team that owns the Deployment Target: the id of a Team in workspace.yaml.
targets.<id>.tags list of string Free-form labels for the Deployment Target.
targets.<id>.links list of Link Links to pages about the Deployment Target, such as a dashboard.
targets.<id>.targets map of id → Deployment Target The Deployment Targets inside this one, keyed by id, such as the clusters in a region.
Field Type Required Default Description
deployments list of object Deployments: which Service runs in which Environment on which Deployment Target, with its URLs.
deployments[] object A Deployment: one Service running in one Environment on one Deployment Target. The three together name it, so the same three can appear only once.
deployments[].service reference yes The Service that runs: an id in this Project, or project:id. It must name a Service, not a System or a Component.
deployments[].environment id yes The Environment it runs in: the id of an Environment in workspace.yaml.
deployments[].target reference yes The Deployment Target it runs on: an id in this Project, or project:id for one another Project declares.
deployments[].url URL The Service’s main URL in this Environment. A full URL, such as https://cart.example.com.
deployments[].endpoints list of object Further named URLs of the Service in this Environment, such as a health check or an admin console.
deployments[].endpoints[] object A further named URL of the Service in this Environment.
deployments[].endpoints[].name string yes What the endpoint is, such as health or admin.
deployments[].endpoints[].url URL yes The endpoint’s address. A full URL.
deployments[].instances integer ≥ 1 or object 1 How many interchangeable copies of the Service run on this Deployment Target: a whole number for a fixed count, such as 3, or { min, max } for an autoscale range, such as { min: 2, max: 10 }. Use it for identical workers on one Target, such as an App Service plan running N instances. When where each copy runs matters, such as one per availability zone or VM, declare separate Deployments on separate Targets instead.
deployments[].instances.min integer ≥ 1 yes The fewest instances the autoscaler runs.
deployments[].instances.max integer ≥ 1 yes The most instances the autoscaler runs. At least min.

A link to a page about the thing it is declared on, such as a runbook or a dashboard.

Field Type Required Default Description
label string yes The text of the link, such as Runbook.
url URL yes The page the link opens. A full URL, such as https://wiki.example.com/runbooks/web.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.