Skip to main content

Deployment

The deployment key can be used to provide guardrails and custom form fields for deployments in Vela.

By default, this key is not set.

Keys

KeyRequiredTypeDescription
templateNstructLike template key for steps: used to pull in deploy config
targetsN[]stringAllowed targets for a deployment
parametersNmap[string]structExpected parameters for a deployment

Usage

The template: key

The following keys can be used to configure a template injection:

NameDescription
nameName of template to inject for the deployment config
varsVariables injected into the template
---
deployment:
template:
# Name of template to inject as the deployment configuration. The name must map
# to an existing template in the parent "template" key.
name: example
---
deployment:
template:
name: example
# Variables injected into the template. Variables can be any
# primitive or complex YAML types but the corresponding template
# needs to understand how those templates are to be used.
vars:
require_targets: false
include_cluster_parameter: true

The targets: key

---
deployment:
# Allowed targets for a deployment. If a user attempts to trigger
# a deployment targeting another value, it will fail.
targets: [dev, stage, prod]

The parameters key

KeyTypeDescription
descriptionstringDescription of the parameter (will appear in UI)
typestringParameter primitive type
requiredboolWhether or not the parameter must be supplied to deployment
options[]stringAllowed parameter values
minintegerParameter minimum value (used for integer type)
maxintegerParameter maximum value (used for integer type)
---
# deployment config using all keys available
deployment:
targets: [ dev, stage, prod ]
parameters:
region:
# type: defaults to string
description: region to deploy to
required: true
options: [ us-west, us-east, us-north, us-south ]
count:
description: number of clusters to deploy
type: int # can be int, integer, or number
required: false # Vela step has a default
min: 1
max: 10
run_tests:
description: run tests prior to deployment
type: bool # can be bool, boolean
---
templates:
- name: deploy
source: vela-templates/deploy.yml
type: file

# deployment config being pulled in from a template
deployment:
template:
name: deploy

Deployment configurations will generate form validation in the UI when users are on the Add Deployment page. Any deployments that violate the configuration will be blocked.