Explains using Argo Rollouts AnalysisTemplate and AnalysisRun to validate application health during canary and blue-green rollouts, including placements, blocking behavior, and examples.
In this lesson we trigger an AnalysisRun using the AnalysisTemplate we defined earlier. AnalysisRuns verify application health during rollouts and can be integrated with Argo Rollouts in several ways depending on strategy (Canary or Blue-Green) and whether the analysis should block the rollout or run concurrently.Key concepts:
AnalysisTemplate: reusable template that defines metrics and success conditions.
AnalysisRun: an execution of an AnalysisTemplate.
Placement: where the AnalysisRun is started (background, inline, pre-promotion, post-promotion).
Blocking vs non-blocking: whether the rollout waits for the AnalysisRun to finish.
If you’re using a canary strategy, analysis can run in the background while the canary advances through its steps, or it can be run inline and block the rollout at a particular step.
Background analysis: declared at the top-level of the canary block so it runs independently while steps execute.
Inline analysis: tied to a specific step and blocks progression until the AnalysisRun completes.
You reference the AnalysisTemplate by name and pass any required args. Below is the AnalysisTemplate used in this lesson: it performs HTTP GETs against a service-health endpoint and treats HTTP 2xx responses as success.kubectl describe output for the AnalysisTemplate (trimmed for clarity):
In this lesson we configured the highway-bluegreen Rollout to use prePromotionAnalysis against the preview service. Relevant portion of the Rollout spec we applied (trimmed):
Note: Setting autoPromotionEnabled: false prevents automatic promotion even after a successful pre-promotion analysis. The Rollout will pause and require a manual promotion action (via UI or kubectl argo rollouts promote).
When we deployed the new (green) version, the Rollout created the preview ReplicaSet and automatically triggered a pre-promotion AnalysisRun. The template ran the health-check metric three times (Count: 3) and recorded three successful measurements.
Because the health checks passed, the AnalysisRun succeeded. Because autoPromotionEnabled was set to false, the Rollout remained paused awaiting a manual promotion.
You can inspect the Rollout and see the paused state, the revisions (stable/active and preview), and the successful AnalysisRun:
After reviewing the AnalysisRun results, an administrator can manually promote the preview to active (UI or kubectl argo rollouts promote). Promotion switches the active service to route production traffic to the new revision (green) only when the analysis has validated health.This workflow enables progressive and safe promotion: only when an AnalysisRun passes do you promote the preview into production. Error handling (abort/rollback) is out of scope for this lesson but is supported by Argo Rollouts and should be part of production policies.
Blocking analyses (inline or pre-promotion) will pause rollouts until the AnalysisRun completes. Use background analysis when you want non-blocking monitoring, and use pre/post-promotion for stricter gates.
Summary table — Analysis placements and behavior
Placement
Strategy
Blocks rollout?
Typical use case
background
Canary
No
Continuous monitoring during phased traffic shifts