Skip to main content
Cluster operationsLesson 10 of 16

Progressive Delivery with Argo Rollouts

A plain Deployment replaces Pods and hopes for the best. Follow a Rollout as it sends a growing share of traffic to a new version, checks a success rate in Prometheus at each step, and aborts on its own when the check fails.

Canary weight0%
Analysis—
Rollout statusHealthy
Namespace shopYou or CInew image tagRollouts controllerargo-rolloutsPrometheusrequest metricsRollout webtemplate + strategyTraffic routerIngress · mesh · GatewayAnalysisRunsuccess-rateService web-stablestable · activeService web-canarycanary · previewReplicaSet v1stableReplicaSet v2new versionWatch100%
RequestResponse / reportWatchAppears in a later step

What you will learn

  • A Rollout replaces a Deployment and adds canary or blue-green steps
  • Replica-count weights versus a traffic router
  • An AnalysisTemplate that queries Prometheus
  • Automatic abort when analysis fails, and what abort leaves
  • Blue-green with a preview Service and promotion

Canary or blue-green, and which commands​

CanaryBlue-green
Traffic movesIn steps (setWeight), by Pod count or by a traffic routerAll at once, when the active selector changes
Extra capacityOnly canary Pods (stable stays full with a router)A full second copy until scaleDownDelaySeconds passes
Test before usersSmall share of real userspreviewService and prePromotionAnalysis
Automatic checkBackground analysis or analysis stepsprePromotionAnalysis, postPromotionAnalysis
Exact percentagesNeed trafficRouting (Ingress, mesh, Gateway API plugin)Not needed
CommandWhat it does
kubectl argo rollouts get rollout web --watchLive steps, weight, ReplicaSets and AnalysisRuns
kubectl argo rollouts promote webLeave the current pause and go to the next step
kubectl argo rollouts promote web --fullSkip all remaining steps, pauses and analysis
kubectl argo rollouts abort webSend traffic back to stable and stop. The spec is not changed
kubectl argo rollouts retry rollout webStart an aborted Rollout again with the same spec
kubectl argo rollouts undo webRoll the template back to the previous revision

Try it yourself​

kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/rollout.yaml # demo Rollout (5 replicas)
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/service.yaml
kubectl argo rollouts get rollout rollouts-demo --watch # keep this open in a second terminal
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:yellow # start a canary
kubectl argo rollouts promote rollouts-demo # leave the indefinite pause
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:red
kubectl argo rollouts abort rollouts-demo # back to stable, status Degraded
kubectl get analysisrun # results, if the Rollout uses analysis

Check yourself

  1. A canary Rollout has 4 replicas and no trafficRouting. Why can setWeight: 10 not give the canary exactly 10% of requests?
  2. The AnalysisRun fails and the Rollout aborts. What is true right after the abort?
  3. In blue-green, why is the old ReplicaSet kept for scaleDownDelaySeconds after promotion?

Further reading: Argo Rollouts docs · Canary · Blue-green · Analysis and progressive delivery · Traffic management · Blue/green and canary with core primitives (CKAD) · Service Mesh ② Splitting Traffic