How to Use Argo Rollouts for Progressive Delivery
An Argo Rollouts Rollout replaces a Deployment and advances a new version through weighted canary steps with pauses for analysis.
Define a Rollout with a canary strategy of setWeight and pause steps. GitOps commits the new image, and Rollouts shifts traffic gradually, pausing for manual or automated checks.
Steps
- Install the Argo Rollouts controller.
- Convert the
Deploymentto aRolloutresource. - Define canary
stepswithsetWeightandpause. - GitOps updates the image; Rollouts runs the canary.
Rollout manifest
apps/api/rollout.yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: api
spec:
replicas: 5
strategy:
canary:
steps:
- setWeight: 20
- pause: { duration: 5m }
- setWeight: 50
- pause: {}
- setWeight: 100
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: ghcr.io/my-org/api:v1.4.2Gotchas
- An empty
pause: {}waits indefinitely until you promote withkubectl argo rollouts promote api. - Pair canary steps with an AnalysisTemplate to abort automatically on bad metrics.
Related guides
How to Create an Argo CD ApplicationDefine an Argo CD Application manifest that points at a Git repo and path, and set an automated sync policy s…
How to Roll Back a GitOps Deploy With git revertRoll back a GitOps deployment by reverting the offending commit in the config repo, so the controller syncs t…