Skip to main content
A deployment manages a fleet of nodes running on a capacity. You specify a node template and a target node count. The deployment creates and removes nodes to match the target. Without a deployment, you create and manage nodes manually. If a node is destroyed because its allocation ended, nothing replaces it. A deployment maintains your target count by creating a new node in awaiting_allocation state, which starts running when allocation becomes available.

Create a deployment

sf deployments create \
  --capacity dev \
  --node-template prod-ubuntu \
  --target-node-count 4
This creates a deployment that maintains 4 nodes on the dev capacity, each configured according to the referenced node template.

Node templates

A deployment references a node template that defines the image, cloud-init script, and other configuration for each node. Create a node template first, then reference it in the deployment. Updating the node template only affects new nodes created by the deployment.

Node name templates

Nodes created by a deployment get auto-generated names. You can provide a naming pattern with --node-name-template to give nodes predictable names.
sf deployments create \
  --capacity dev \
  --node-template prod-ubuntu \
  --target-node-count 4 \
  --node-name-template "worker-{{nanoid(10)}}"

List deployments

sf deployments list
NAME              CAPACITY      NODES  STATUS  MESSAGE
prod-workers      prod-cluster  8      info    running
ml-training-pool  ml-training   32     info    running

Get deployment details

sf deployments get prod-workers
│ DEPLOYMENT ID   depl_Xm9pR2wLk7Nf3Qy8Td5V
│ NAME            prod-workers
│ CAPACITY        prod-cluster (cap_yIwQRIaE8bJo4Gs0000)
│ NODE TEMPLATE   prod-ubuntu (ntmpl_Gw5rT8mKn2Pj4Lx9Qf7Y)
│ TARGET NODES    8
│ NAME TEMPLATE   {{adjective}}-{{noun}}-{{nanoid(6)}}
│ STATUS          info
│ MESSAGE         running
│ CREATED         Mar 25, 2:00pm PDT
└ UPDATED         Mar 30, 1:00pm PDT

Update a deployment

Change the target node count, node template, or name.
sf deployments set prod-workers --target-node-count 16
Switch to a different node template.
sf deployments set prod-workers --node-template prod-ubuntu-v2

Delete a deployment

sf deployments delete prod-workers
Deleting a deployment deletes all nodes that are running under that deployment.

API reference

See the Deployments API for programmatic access.