Get Started with Argo Rollouts Deployment
Objectives
In this guide, you learn how to use Argo Rollouts with Armory CD-as-a-Service.
- Create a CD-as-a-Service deployment config file
- Add your Rollout manifest
- Deploy your app
- Extend deployment functionality to use webhooks and to deploy multiple rollouts
Before you begin
Make sure that you have performed the following steps:
To complete this quick start, you need the following:
-
Access to a Kubernetes cluster where you have installed the Remote Network Agent (RNA). This cluster acts as the deployment target for the sample app. (Optional) You can connect multiple Kubernetes clusters to deploy to multiple environments
-
One or more Argo Rollout manifests. For example:
# rollout.yaml apiVersion: argoproj.io/v1alpha1 kind: Rollout metadata: name: example spec: replicas: 5 ...
Create a CD-as-a-Service deployment config file
Create a file called armoryDeployment.yaml
with the following contents:
# armoryDeployment.yaml
version: v1
kind: kubernetes
application: <app-name>
targets:
staging:
account: <cluster-name> # Name of the cluster you entered when installing the RNA.
namespace: <namespace>
production:
account: <cluster-name>
namespace: <namespace>
constraints:
dependsOn: [staging]
beforeDeployment:
- pause:
untilApproved: true
manifests:
- path: <path-to-app-manifest>
This example includes multiple targets. You can remove or add targets to match your environment.
Be sure to replace <app-name>
, <cluster-name>
, and <namespace>
placeholders with your own values.
See Create a Deployment Config File for Armory CD-as-a-Service if you want to create a more robust deployment config file. The Deployment Config File Reference for CD-as-a-Service page contains explanations of the fields.
Add your Rollout manifest
-
Go to the
manifests
section in your deployment config file. -
Add your Argo Rollout manifests in the
manifests[].path
section:# armoryDeployment.yaml version: v1 kind: kubernetes ... manifests: - path: rollout.yaml
Deploy your app
-
Ensure you have logged into CD-as-a-Service:
armory login
-
Start your deployment using the Armory CLI:
armory deploy start -f armoryDeployment.yaml --watch
Remove the
--watch
flag if you don’t want to output deployment status in your terminal.
If you are only deploying Argo Rollouts, CD-as-a-Service ignores any strategy you configure in your deployment config file. The Rollout follows the strategy defined in the Rollout manifest.
Extend functionality for Rollout deployments
Run integration tests using webhooks
You can use webhooks in afterDeployment
constraints to add specific logic for Argo Rollouts to finish deploying before starting integration tests. For example:
# armoryDeployment.yaml
version: v1
kind: kubernetes
application: my-application
targets:
staging:
account: staging
namespace: default
constraints:
afterDeployment:
- runWebhook:
name: Refer to Argo Rollouts for status
manifests:
- path: rollout.yaml
webhooks:
- name: Refer to Argo Rollouts for status
method: POST
uriTemplate: http://cmd-hook.default:8081/cmd
networkMode: remoteNetworkAgent
agentIdentifier: <cluster-name>
retryCount: 3
bodyTemplate:
inline: >-
{
"cmd": "kubectl",
"arg": "wait -n=default rollout/example --for=condition=Completed --timeout=30m",
"callbackURL": "{{armory.callbackUri}}/callback"
}
Deploy multiple Argo Rollouts
To deploy multiple Argo Rollouts together, you can add more paths to the manifests
section of the deployment config file:
manifests:
- path: rollout-1.yaml
- path: rollout-2.yaml
- path: rollout-3.yaml
What’s next
- Troubleshoot CD-as-a-Service Tools
- Deployment Config File Reference for CD-as-a-Service
- External Automation Using Webhook-Based Approvals
- Configure a Webhook in the Deployment File
Feedback
Was this page helpful?
Thank you for letting us know!
Sorry to hear that. Please tell us how we can improve.
Last modified February 1, 2023: (3bd43b4)