Skip to main content

Argo Rollouts

Argo Rollouts is a Kubernetes controller that replaces the Deployment with blue-green and canary strategies, shifting traffic in steps and rolling back automatically when metrics degrade.

Understanding Argo Rollouts

What Is Argo Rollouts and Why Use It Over a Deployment

Argo Rollouts is a Kubernetes controller and set of CRDs that adds progressive delivery to your cluster. You use a Rollout resource instead of a Deployment, and it releases a new version in controlled steps (canary or blue-green) while checking real metrics from tools like Prometheus. If the metrics look bad, it aborts and returns traffic to the stable version without a human.

A plain Deployment performs a rolling update and only asks one question: are the new pods ready? It cannot tell that the new version returns 5xx errors on 3% of requests or doubled p99 latency. Argo Rollouts adds the missing judgment: expose a small slice of traffic, measure, then decide to promote or roll back.

How a Canary Rollout Progresses

A canary rollout runs a list of steps in order. Each step either sets the canary weight, pauses for a duration or for manual approval, or runs an analysis. The first failed analysis aborts the rollout and scales the canary down.

flowchart TD A[New image deployed] --> B[Canary gets 10% traffic] B --> C{Analysis healthy?} C -->|Yes| D[Promote 25, 50, 100] C -->|No| E[Abort and roll back] classDef step fill:#326CE5,color:#FFFFFF classDef good fill:#10B981,color:#FFFFFF classDef bad fill:#EF4444,color:#FFFFFF class A,B,C step class D good class E bad

Exact traffic percentages need a traffic router such as Istio, NGINX Ingress, or the AWS ALB controller, configured under trafficRouting. Without one, Argo Rollouts approximates the weight by scaling canary and stable replica counts, so 10% of 10 pods is one canary pod.

Rollout and AnalysisTemplate Example

YAML
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: payment-api
namespace: payments
spec:
replicas: 10
selector:
matchLabels:
app: payment-api
template:
metadata:
labels:
app: payment-api
spec:
containers:
- name: payment-api
image: 123456789.dkr.ecr.ap-south-1.amazonaws.com/payment-api:v1.2.3
strategy:
canary:
steps:
- setWeight: 10
- analysis:
templates:
- templateName: payment-api-error-rate
args:
- name: service-name
value: payment-api
- setWeight: 25
- pause: {duration: 5m}
- setWeight: 50
- pause: {duration: 5m}
# after the last step the canary becomes 100 percent
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: payment-api-error-rate
namespace: payments
spec:
args:
- name: service-name
metrics:
- name: error-rate
interval: 1m
count: 5
# fail closed: no data counts as a bad result, not a pass
successCondition: len(result) > 0 && result[0] < 0.01
failureLimit: 2
provider:
prometheus:
address: http://prometheus.monitoring:9090
query: |
sum(rate(http_requests_total{service="{{args.service-name}}",status=~"5.."}[2m]))
/
sum(rate(http_requests_total{service="{{args.service-name}}"}[2m]))

Everyday kubectl Plugin Commands

Bash
# Watch a rollout live
kubectl argo rollouts get rollout payment-api -n payments --watch
# Trigger a new rollout by changing the image
kubectl argo rollouts set image payment-api payment-api=123456789.dkr.ecr.ap-south-1.amazonaws.com/payment-api:v1.2.4 -n payments
# Skip a manual pause and continue
kubectl argo rollouts promote payment-api -n payments
# Abort (traffic returns to stable) and retry later
kubectl argo rollouts abort payment-api -n payments
kubectl argo rollouts retry rollout payment-api -n payments

Blue-Green vs Canary

Strategy Best for
Canary Gradual exposure with metric checks at each step
Blue-green Instant switch with a full preview environment

Troubleshooting

Symptom Check What to Look For
Analysis always fails Run the PromQL query in Prometheus Wrong label names or no data returned
Rollout stuck on pause kubectl argo rollouts get rollout An indefinite pause: {} waiting for promote
Canary receives no traffic Service and trafficRouting config Selector labels or router reference mismatch
Pods not scaling down HPA and replicas conflicts HPA must target the Rollout, not a Deployment
Tip

Start with setWeight and manual pause steps only. Once the team trusts the lifecycle, add automated analysis using thresholds based on real baseline traffic.

Remember

A Rollout replaces a Deployment. Existing Deployments can be converted by referencing them with workloadRef, so you can migrate without rewriting the pod template.

Security

An analysis that silently passes when Prometheus is broken disables your safety gate. Write success conditions that fail on empty results, and test the template with synthetic bad traffic before relying on it.

Common Mistake

Starting the first canary step at 50%. That puts half of production on an unproven version. Begin at 5 to 10% so the blast radius stays small.

Frequently Asked Questions

How is Argo Rollouts different from a Kubernetes rolling update?

A rolling update replaces pods gradually and only checks pod readiness. Argo Rollouts adds traffic weighting, pause points, and metric-driven analysis, and it can abort and restore the stable version automatically when error rate or latency crosses a threshold.

Do I need a service mesh to use Argo Rollouts?

No. Without a traffic router it shifts load by adjusting replica counts, which gives coarse percentages. A mesh or ingress integration such as Istio or NGINX gives exact weights and is recommended for precise canaries.

What is the difference between Argo Rollouts and ArgoCD?

ArgoCD syncs manifests from Git to the cluster, while Argo Rollouts controls how a new version is released once applied. They are separate projects and are often used together: ArgoCD applies the Rollout, and Rollouts performs the progressive release.

Found a mistake, an outdated step or a broken link?