tezvyn:

Argo Rollouts: Beyond Kubernetes Rolling Updates

AI-drafted, machine-checkedSource: argoproj.github.iointermediate

Argo Rollouts replaces Kubernetes' basic `RollingUpdate` with safer, controlled strategies like canary and blue-green. It gradually shifts traffic to new versions while monitoring metrics, automating rollbacks if KPIs degrade.

WHY IT EXISTS: The native Kubernetes Deployment object's RollingUpdate strategy is often too risky for production. It lacks fine-grained control over rollout speed and traffic flow, cannot query external metrics to verify an update's health, and cannot automatically roll back on failure. It provides little control over the blast radius, making it a blunt instrument for critical services.

THE MENTAL MODEL: Think of Argo Rollouts as a smart traffic cop for your Kubernetes deployments. Instead of just replacing old pods with new ones, it stands at the intersection (your ingress or service mesh) and directs a small percentage of traffic to the new version. It then checks its monitors (Prometheus, Datadog) to see if key business metrics are healthy before gradually sending more traffic, ready to halt and revert at the first sign of trouble.

HOW IT WORKS: You define an Argo Rollout custom resource, which replaces the standard Deployment resource. This Rollout object manages ReplicaSets but adds advanced strategy options. For a canary deployment, you specify steps like 'send 10% of traffic to the new version, pause for 5 minutes, then run an analysis'. This analysis can query a metric provider to check error rates or latency. Argo Rollouts achieves this traffic shifting by integrating with and manipulating the configuration of a service mesh (like Istio) or an ingress controller (like NGINX or an AWS ALB).

WHEN TO USE IT: Use Argo Rollouts for critical, high-volume production services where a failed deployment has a significant user or business impact. It's essential when you want to de-risk releases by tying promotion to business KPIs (like conversion rates) or system KPIs (like P99 latency), not just basic pod readiness probes.

WHEN NOT TO USE IT: For simple applications, internal tools, or development environments, a standard Kubernetes RollingUpdate is often sufficient and simpler. If you don't use a compatible ingress controller or service mesh, you lose the primary benefit of traffic shaping and should stick with the native Deployment object.

ONE CANONICAL EXAMPLE: A team uses a canary strategy for their checkout service. The Rollout CRD is configured to first shift 5% of traffic to the new version. It then pauses and runs an AnalysisRun that queries Prometheus for the new version's HTTP 5xx error rate. If the error rate remains below 0.1% for ten minutes, the rollout proceeds to 25% traffic. If the error rate spikes at any point, the rollout is automatically aborted and rolled back to the previous stable version.

Read the original → argoproj.github.io

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.