Demo showing Argo Rollouts aborts and scales down updates when a pre-promotion AnalysisRun fails, preventing unhealthy revisions from being promoted to production.
In this lesson we deploy a faulty version of the application and observe how Argo Rollouts automatically aborts (and scales down) the update when a pre-promotion AnalysisRun fails. This demonstrates how analysis protects production traffic by preventing automatic promotion of unhealthy revisions.
2) Update the Rollout to use the error image and watch the pre-promotion AnalysisRun
When the Rollout is updated to use the faulty image in the argo-analysis-lab namespace, Argo Rollouts creates a new revision (ReplicaSet) and a preview Service, then executes the configured pre-promotion AnalysisRun against that preview Service.Check cluster resources:
Copy
kubectl -n argo-analysis-lab get all
Condensed sample output (shows existing stable ReplicaSet and the new preview ReplicaSet in ContainerCreating):
The preview Service (new revision) returns the same 400 error when probed, while the active/stable Service continues to return 200 OK.Preview (failing revision):
{ "code": 200, "status": "OK", "message": "Highway Animation Server is running", "timestamp": 1761387072985}
Because the AnalysisRun metric observed non-2xx responses repeatedly, it reached the configured consecutive-error threshold and the analysis aborted. The Rollouts UI and console display the metric failure and the reason:
When the analysis fails, the Rollout controller scales down the preview ReplicaSet and marks the Rollout as degraded/aborted so production traffic is not promoted to the faulty revision:
The production/active revision remains unchanged and continues serving live users:
After the analysis aborted, the preview ReplicaSet was scaled down to zero while the stable ReplicaSet stayed healthy:
BlueGreen: analysis can run pre-promotion against the preview Service (as in this demo). The Rollout will only switch active traffic after the pre-promotion analysis succeeds.
Canary: analysis can be used as a background analysis (runs continuously during the canary rollout) or as an inline step analysis (runs at a specific step/weight).
Example: configure an analysis to start after a specific canary step (start after step that sets weight to 40%):
You can run AnalysisRuns standalone by creating an AnalysisRun object directly (inline metrics or referencing templates). AnalysisTemplates can be defined cluster-wide and referenced with clusterScope: true to reuse them across namespaces.Example referencing a cluster-scoped template:
Argo Rollouts runs AnalysisRuns against preview or canary services before promotion.
If analysis metrics do not meet configured success conditions (for example, repeated non-2xx HTTP responses), the AnalysisRun fails.
When the AnalysisRun fails, the Rollout aborts the update, scales down the preview ReplicaSet, and prevents production traffic from being promoted to the faulty revision.
Use AnalysisTemplates (namespace-scoped or cluster-scoped) to standardize health and success checks across Rollouts.
Always verify analysis metrics and thresholds carefully. Incorrect thresholds or misconfigured queries can cause false positives (abort a healthy rollout) or false negatives (allow unhealthy releases).