Kubernetes Deployments do rolling updates: replace pods one by one. If the new version is broken, you find out after all pods are updated. Argo Rollouts adds canary and blue-green strategies with automated analysis — bad versions are rolled back before they affect all users.
Installation
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f \
https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
# Install kubectl plugin
brew install argoproj/tap/kubectl-argo-rolloutsCanary Deployment
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: order-api
spec:
replicas: 10
strategy:
canary:
steps:
- setWeight: 5
- pause: { duration: 2m }
- setWeight: 20
- pause: { duration: 5m }
- setWeight: 50
- pause: { duration: 5m }
- setWeight: 80
- pause: { duration: 2m }
selector:
matchLabels:
app: order-api
template:
metadata:
labels:
app: order-api
spec:
containers:
- name: order-api
image: myorg/order-api:v2.0.0
ports:
- containerPort: 8080Traffic shifts: 5% → wait 2 min → 20% → wait 5 min → 50% → 80% → 100%. At each pause, you can verify metrics or let automated analysis decide.
Master this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Automated Analysis
The real power is metrics-based promotion:
strategy:
canary:
steps:
- setWeight: 10
- pause: { duration: 2m }
- analysis:
templates:
- templateName: success-rate
- setWeight: 50
- pause: { duration: 5m }
- analysis:
templates:
- templateName: success-rate
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
metrics:
- name: success-rate
interval: 1m
count: 5
successCondition: result[0] >= 0.99
provider:
prometheus:
address: http://prometheus.monitoring:9090
query: |
sum(rate(http_requests_total{
app="order-api",
status=~"2..",
rollouts_pod_template_hash="{{args.canary-hash}}"
}[2m]))
/
sum(rate(http_requests_total{
app="order-api",
rollouts_pod_template_hash="{{args.canary-hash}}"
}[2m]))If the canary's success rate drops below 99%, Argo Rollouts automatically rolls back. No human intervention needed.
Blue-Green Deployment
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: order-api
spec:
replicas: 5
strategy:
blueGreen:
activeService: order-api-active
previewService: order-api-preview
autoPromotionEnabled: false
prePromotionAnalysis:
templates:
- templateName: smoke-tests
scaleDownDelaySeconds: 300
selector:
matchLabels:
app: order-api
template:
metadata:
labels:
app: order-api
spec:
containers:
- name: order-api
image: myorg/order-api:v2.0.0The new version runs alongside the old. Preview service lets you test the new version. After analysis passes, traffic switches instantly from old to new.
Traffic Management
Integrate with service meshes and ingress controllers:
strategy:
canary:
trafficRouting:
nginx:
stableIngress: order-api-ingress
additionalIngressAnnotations:
canary-by-header: X-Canary
# Or with Istio:
# istio:
# virtualService:
# name: order-api-vsvcWith traffic routing, the weight percentages control actual network traffic — not just pod ratios.
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Monitoring Rollouts
# Watch rollout status
kubectl argo rollouts get rollout order-api --watch
# Manually promote a paused rollout
kubectl argo rollouts promote order-api
# Abort and rollback
kubectl argo rollouts abort order-api
# Retry after abort
kubectl argo rollouts retry rollout order-apiDashboard
kubectl argo rollouts dashboard
# Opens web UI showing rollout status, canary weight, analysis resultsWhen to Use Argo Rollouts
Good fit: - Services where bad deployments cost money (payments, auth, core API) - Teams with Prometheus metrics for automated analysis - Organizations needing audit trails for deployment decisions - High-traffic services where even 5% errors affect thousands of users
Not needed: - Internal tools with low traffic - Services where a 30-second rolling update is acceptable risk - Teams without metrics infrastructure for automated analysis
Start with canary on your most critical service. Once you trust the analysis, expand to other services.
---
Ready to go deeper? Master Kubernetes deployment strategies with hands-on courses at CopyPasteLearn.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
Kubernetes Deployment Strategies
Deploy safely with Kubernetes strategies. Rolling updates, blue-green, canary releases, recreate mode, and automated rollback.
Helm Charts Beginner Tutorial
Get started with Helm charts for Kubernetes. Install community charts, create custom charts, manage values files, and handle releases.
Devtron Kubernetes Application Manager
Devtron provides a complete CI/CD platform for Kubernetes with a web UI, Helm chart management, and GitOps. Learn how Devtron simplifies application.
Argo Workflows Kubernetes Guide
Argo Workflows runs complex DAG-based workflows on Kubernetes. Learn how to build multi-step pipelines for data processing, ML training, CI/CD.
Autonomous Industrial Systems
Deploy and manage autonomous industrial systems with IIoT platforms, digital twins, predictive maintenance, and industrial DevOps practices.
AWS IAM Roles and Policies Guide
Understand AWS IAM roles, policies, and best practices for secure cloud access. Least privilege principles, role assumption, and Terraform IAM automation.
Explore topics
Browse more articles on the topics covered here.