Zero Downtime Deployments with Kubernetes and Argo Rollouts
Delivering new features quickly is important, but not at the cost of application stability. In modern DevOps workflows, zero downtime deployments are a must. That’s where Kubernetes and Argo Rollouts come in — offering powerful strategies like canary and blue/green deployments along with live metrics checks for safe and seamless releases.
This article explains how to implement zero downtime deployments using Argo Rollouts on Kubernetes, with practical examples and a comparison of canary vs. blue/green strategies.
1. What is Argo Rollouts?
Argo Rollouts is a Kubernetes controller and set of CRDs (Custom Resource Definitions) that provides advanced deployment strategies:
- Canary deployments
- Blue/Green deployments
- Progressive delivery
- Traffic shaping (via service mesh or ingress)
- Live analysis using Prometheus, Kayenta, etc.
It works as a drop-in replacement for Kubernetes Deployments.
2. Blue/Green vs. Canary: Key Differences
| Feature | Blue/Green | Canary |
|---|---|---|
| Rollout style | Deploy full new version alongside old | Gradually shift traffic to new version |
| Traffic switching | All at once | Incremental (step-by-step) |
| Rollback | Quick via switching services | Step-level rollback possible |
| Testing | Manual or automated QA on green | Real user traffic + metric analysis |
| Risk | Medium | Low |
| Use Case | High confidence releases | Low-risk progressive testing |
3. Example: Blue/Green Deployment with Argo Rollouts
1. Define the Rollout:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app
spec:
replicas: 3
strategy:
blueGreen:
activeService: my-app
previewService: my-app-preview
autoPromotionEnabled: false
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:v2
2. Services:
apiVersion: v1
kind: Service
metadata:
name: my-app
spec:
selector:
app: my-app
apiVersion: v1
kind: Service
metadata:
name: my-app-preview
spec:
selector:
app: my-app
kubectl argo rollouts promote my-app
🐦 Example: Canary Deployment with Argo Rollouts
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app
spec:
replicas: 3
strategy:
canary:
steps:
- setWeight: 20
- pause: { duration: 2m }
- setWeight: 50
- pause: { duration: 5m }
- setWeight: 100
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:v2
This will:
- Send 20% of traffic to the new version
- Pause to monitor
- Increase to 50%, then 100%, with pauses
4. Live Metrics Checks with Prometheus
Argo supports automated analysis using Prometheus or Kayenta. Here’s a snippet for integrating Prometheus:
analysis:
templates:
- name: success-rate-check
metrics:
- name: success-rate
interval: 1m
successCondition: result[0] > 0.95
provider:
prometheus:
address: http://prometheus:9090
query: |
sum(rate(http_requests_total{status=~"2.."}[1m])) /
sum(rate(http_requests_total[1m]))
This automatically checks if 95%+ of requests are successful before progressing.
5. Best Practices for Zero Downtime Deployments
✅ Always test new versions on a preview service before promoting
- ✅ Use canary when unsure about release quality
- ✅ Integrate automated analysis to catch issues early
- ✅ Use progressive traffic shifting with pauses and alerts
- ✅ Ensure rollback is fast and reliable
6. Conclusion
With Argo Rollouts, Kubernetes becomes a powerful platform for safe and zero-downtime deployments. Whether you choose blue/green for fast promotion or canary for cautious rollout, Argo gives you fine-grained control, live metric checks, and rollback capabilities to deploy confidently.






