Which mechanism is used in a GitOps workflow to ensure that a 'Canary' deployment successfully rolls back if error rates spike?
Flagger's AnalysisTemplates define the metrics queries and thresholds that the canary controller continuously evaluates during a rollout. When error rates breach the specified limits, the template triggers an automatic rollback to the last stable revision, satisfying the stem's requirement for metric-driven, unattended rollback.
Why this answer
Flagger AnalysisTemplates define the metrics, thresholds, and intervals used to evaluate a canary's health; if error rates exceed thresholds, Flagger automatically aborts and rolls back the canary. This is the mechanism purpose-built for automated canary analysis and rollback in a GitOps workflow. It integrates with service meshes and ingress controllers to shift traffic progressively.
Exam trap
CGOA often tests the confusion between liveness probes (container health) and canary analysis (traffic-based metric evaluation), causing candidates to pick probes or manual pauses instead of AnalysisTemplates.
How to eliminate wrong answers
Option A is wrong because Kubernetes Liveness Probes only restart unhealthy containers; they do not analyze error rates or roll back a canary deployment. Option B is wrong because Argo Rollouts 'pause' condition halts progression for manual or timed approval, but by itself does not automatically roll back on error-rate spikes without an AnalysisTemplate. Option C is wrong because Git revert via CI/CD is a manual or pipeline-driven action, not an automated runtime rollback triggered by live error metrics.