Deployment Reference
Deployment config file reference overview
The deployment config file is what you use to define how and where Armory CD-as-a-Service deploys your app.
Make sure you have installed the CD-as-a-Service CLI, which you can use to generate a deployment template.
Templates
You can generate a template file by running the following command with the CLI:
Basic template:
armory template kubernetes [command]
where command
is the type of template.
Automated canary analysis template:
armory template kubernetes canary -f automated
Blue/green deployment template:
armory template kubernetes bluegreen
To use a template, output it to a file and modify it to suit your needs:
armory template kubernetes [template-type] > deployment-template.yaml
How to create a deployment config file
Generate your deployment config template and output it to a file.
For example, this command generates a deployment template for canary deployments and saves it to a file named
canary.yaml
:armory template kubernetes canary > canary.yaml
Customize your deployment file by setting the following minimum set of parameters:
application
: The name of your app.targets.<deploymentName>
: A descriptive name for your deployment. Armory recommends using the environment name.targets.<deploymentName>.account
: This is the name of your RNA. If you installed the RNA manually, it is the value that you assigned to theagentIdentifier
parameter.targets.<deploymentName>.strategy
: the name of the deployment strategy you want to use. You define the strategy instrategies.<strategy-name>
.manifests
: a map of manifest locations. This can be a directory ofyaml (yml)
files or a specific manifest. Each entry must use the following convention:- path: /path/to/directory-or-file
strategies.<strategy-name>
: the list of your deployment strategies. Use one of these fortargets.<target-cluster>.strategy
.If you are using a canary strategy, the strategy section consists of a map of steps for your canary strategy in the following format:
strategies: my-demo-strategy: # Name that you use for `targets.<deploymentName>.strategy - canary # The type of deployment strategy to use. steps: - setWeight: weight: <integer> # What percentage of the cluster to roll out the manifest to before pausing. - pause: duration: <integer> # How long to pause before deploying the manifest to the next threshold. unit: <seconds|minutes|hours> # The unit of time for the duration. - setWeight: weight: <integer> # The next percentage threshold the manifest should get deployed to before pausing. - pause: untilApproved: true # Wait until a user provides a manual approval before deploying the manifest
Each step can have the same or different pause behaviors. Additionally, you can configure as many steps as you want for the deployment strategy, but you do not need to create a step with a weight set to 100. Once CD-as-a-Service completes the last step you configure, the manifest is deployed to the whole cluster automatically. See the strategies section of the deployment file reference for more information.
(Optional) Configure a deployment timeout.
A deployment times out if the pods for your application fail to be in ready state in 30 minutes. You can optionally configure a deployment timeout by adding a
deploymentConfig
top-level section:deploymentConfig: timeout: unit: <seconds|minutes|hours> duration: <integer>
Note that the minimum timeout you can specify is 60 seconds (1 minute). See the Deployment config section of the deployment file reference for more information.
(Optional) Ensure there are no YAML issues with your deployment file.
Since a hidden tab in your YAML can cause your deployment to fail, it’s a good idea to validate the structure and syntax in your deployment file. There are several online linters, IDE-based linters, and command line linters such as
yamllint
that you can use to validate your deployment file.
You can view detailed configuration options in the Deployment Config File Reference section.
Show me an example deployment file
This file is in the armory/docs-cdaas-sample repo.---
version: v1
kind: kubernetes
application: cdaas-sample-app
# Map of Deployment Targets, this is set up in a way where
# we can do multi-target deployments (multi-region or multi-cluster)
targets:
# This in the name of a deployment. Underneath it is its configuration.
test:
# the agentIdentifier of the Remote Network Agent for this target
account: sample-rna-test-cluster
# Optionally override the namespaces that are in the manifests
namespace: sample-test
# This is the key to a strategy under the strategies map
strategy: rolling
staging:
# the agentIdentifier of the Remote Network Agent for this target
account: sample-rna-staging-cluster
# Optionally override the namespaces that are in the manifests
namespace: sample-staging
# This is the key to a strategy under the strategies map
strategy: rolling
constraints:
dependsOn: ["test"]
beforeDeployment: []
prod-eu:
# the agentIdentifier of the Remote Network Agent for this target
account: sample-rna-prod-eu-cluster
# Optionally override the namespaces that are in the manifests
namespace: sample-prod-eu
# This is the key to a strategy under the strategies map
strategy: mybluegreen
constraints:
dependsOn: ["staging"]
beforeDeployment:
- pause:
untilApproved: true
prod-us:
# the agentIdentifier of the Remote Network Agent for this target
account: sample-rna-prod-us-cluster
# Optionally override the namespaces that are in the manifests
namespace: sample-prod-us
# This is the key to a strategy under the strategies map
strategy: mycanary
constraints:
dependsOn: ["staging"]
beforeDeployment:
- pause:
untilApproved: true
# The list of manifests sources
manifests:
# This reads all YAML files in a dir
# and deploys manifests in that dir to all targets.
- path: manifests/sample-app.yml
# The map of strategies, a deployment target will reference one of these
strategies:
# this is the name for the strategy
mycanary:
# This map key is the deployment strategy type
canary:
steps:
# The map key is the step type
- setWeight:
weight: 25
- pause:
duration: 10
unit: seconds
- setWeight:
weight: 50
- pause:
duration: 10
unit: seconds
- setWeight:
weight: 100
rolling:
canary:
steps:
- setWeight:
weight: 100
mybluegreen:
# This specifies the deployment strategy type
blueGreen:
activeService: cdaas-sample-app-svc
# List of what needs to happen before redirecting traffic
redirectTrafficAfter:
- pause:
duration: 10
unit: seconds
# List of what needs to happen before shutting down the old version
shutDownOldVersionAfter:
- pause:
duration: 20
unit: seconds
What’s next
- Deployment Config File Reference
- Configure a Temporary Preview Link to a Deployed Service
- Configure Role-Based Manual Approval
Feedback
Was this page helpful?
Thank you for letting us know!
Sorry to hear that. Please tell us how we can improve.
Last modified July 20, 2023: (37290cf)