Skip to content

AnalysisTemplate and AnalysisRun: CAPA practice questions

Analysis is how Argo Rollouts decides, from metrics, whether a release may continue. It uses three related resources. An AnalysisTemplate is a reusable, namespaced specification of what to measure: one or more metrics, how often to take each measurement and which results count as success or failure.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What AnalysisTemplate and AnalysisRun covers in CAPA

Analysis is how Argo Rollouts decides, from metrics, whether a release may continue. It uses three related resources. An AnalysisTemplate is a reusable, namespaced specification of what to measure: one or more metrics, how often to take each measurement and which results count as success or failure. A ClusterAnalysisTemplate is the same thing at cluster scope, available to any Rollout, and is referenced with clusterScope: true. An AnalysisRun is an instantiation of a template for one Rollout revision; like a Job, it eventually completes.

Each metric names a provider and its query. Built-in providers include Prometheus, Datadog, New Relic, CloudWatch, Wavefront, Graphite, InfluxDB, Kayenta and SkyWalking, a web provider calls an HTTP endpoint, a job provider runs a Kubernetes Job and judges it by success or failure, and new integrations are added as plugins. successCondition and failureCondition are expressions over the result, for example result[0] >= 0.95. interval sets the time between measurements and count the number of measurements; a metric without an interval takes a single measurement, and one with an interval but no count keeps measuring until the Rollout stops it. failureLimit sets how many failed measurements are tolerated, consecutiveErrorLimit how many errors in a row are tolerated, four by default, and inconclusiveLimit how many inconclusive results are allowed. initialDelay waits before the first measurement.

An AnalysisRun ends Successful, Failed or Inconclusive, and the Rollout continues, aborts or pauses accordingly. A run is inconclusive when a metric has no conditions at all, or when a value meets neither condition, and it then needs a person to resume or abort the Rollout.

Templates are parameterised with args. The template declares arguments and uses them as {{args.name}} in queries, and the Rollout passes values, either literally or from the Pod template hash and other fields with valueFrom. Templates can also be combined: a Rollout can list several, and the controller merges their metrics and arguments into one run. In a canary, background analysis starts with the update, optionally from a startingStep, and runs alongside the steps, while an inline analysis step blocks progress until its run completes. A blue-green Rollout uses prePromotionAnalysis and postPromotionAnalysis instead. dryRun evaluates a metric without letting it affect the Rollout, which helps when introducing a new query.

Key points

  • An AnalysisTemplate defines the metrics; an AnalysisRun is its instantiation for one revision.
  • Successful, Failed and Inconclusive runs make the Rollout continue, abort or pause.
  • A metric with no success or failure condition produces an inconclusive result.
  • ClusterAnalysisTemplates are shared cluster-wide and referenced with clusterScope: true.

Three sample questions

12 CAPA questions on AnalysisTemplate and AnalysisRun, 12 with explanations. How practice works

Question 1

Which Argo Rollouts feature allows automated promotion based on metrics?
  1. A.A pause step with a duration, which promotes the canary once the time is up
  2. B.Analysis templates
  3. C.Anti-affinity injected into the new ReplicaSet so its pods avoid nodes running the old version
  4. D.Promotion rules

Correct answer: B

An AnalysisTemplate defines the metrics to query, how often, and the success and failure conditions; the AnalysisRun created from it decides whether the rollout continues, pauses or aborts, which is how Argo Rollouts promotes or rolls back automatically based on metrics. Why the other options are wrong. "A pause step with a duration, which promotes the cana...": a timed pause only waits for the duration and then moves on; it looks at no metric. "Anti-affinity injected into the new ReplicaSet so its po...": anti-affinity only controls pod placement on nodes and has nothing to do with promotion. "Promotion rules": the Rollouts docs have no feature by that name; metric-driven promotion is done with analysis.

Sources: Argo Rollouts docs: Analysis & Progressive Delivery, Argo Rollouts docs: Canary, Argo Rollouts docs: Anti Affinity

Question 2

What is the purpose of an AnalysisTemplate in Argo Rollouts?
  1. A.To analyze deployment logs and surface error patterns found in the container output
  2. B.To define metric queries and thresholds
  3. C.To analyze resource usage such as CPU and memory consumed by the new ReplicaSet
  4. D.To monitor service health

Correct answer: B

An AnalysisTemplate describes how to run an analysis: the metrics to query, how often, and the values that count as success or failure, with inputs that can be parameterized. AnalysisRuns created from it determine whether the rollout continues, aborts or pauses. Why the other options are wrong. "To analyze deployment logs and surface error patterns f...": templates define metrics and conditions through providers such as Prometheus, not a log analysis feature. "To analyze resource usage such as CPU and memory consum...": resource consumption is not what the template models; it holds metric queries with success conditions. "To monitor service health": the template does not monitor continuously by itself; it defines metrics, and an AnalysisRun executes them.

Sources: Argo Rollouts docs: Analysis & Progressive Delivery

Question 3

What happens when an AnalysisRun fails during a canary deployment?
  1. A.The rollout is paused for manual intervention
  2. B.The analysis is ignored and only recorded as an event, so the canary weight stays unchanged
  3. C.The rollout is automatically aborted and rolled back
  4. D.The rollout continues automatically to the next canary step, treating the failed metrics as advisory only

Correct answer: C

A Failed AnalysisRun makes the Rollout abort, setting the canary weight back to zero, and the Rollout is considered Degraded. Why the other options are wrong. "The rollout is paused for manual intervention": pausing is the outcome for an Inconclusive run, not a Failed one. "The analysis is ignored and only recorded as an event, ...": the run's result decides whether the update continues, aborts or pauses. "The rollout continues automatically to the next canary ...": continuing is the outcome for a Successful run.

Sources: Argo Rollouts docs: Analysis

Practice this topic

Focus mode keeps every question on AnalysisTemplate and AnalysisRun until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CAPA practice across all topics.

Sources

The explanation above was checked against these official documents.