Exercise: The Canary Path
- Setup Canary: Apply a Flagger
Canaryobject for the backend service in thedevelopnamespace. - Trigger Update: Push an image tag change to Git.
- Simulate Health: While the canary is analysis phase, generate healthy traffic using a load test tool. Verify that traffic weight increases (e.g., from 5% to 10%).
- Trigger Rollback: During the next traffic step, simulate failure by calling the
/status/500route on the canary service. - Verify Revert: Observe Flagger detecting the error rate spike and automatically reverting traffic to 100% stable.
Core Exercises (Required)
- Inspect Weight: Use
kubectl get canaries -n developto see the current traffic weight and status of your release. - PromQL Match: Find the PromQL query in your canary manifest and run it manually in Prometheus. Verify that it correctly identifies the error rate.
- Event Trace: Use
kubectl describe canary <name>to trace the timeline of a successful deployment and an automated rollback.
Challenge Exercise (Optional)
Canary Regression Detection: Deploy a canary release with intentionally degraded response times. Verify that Flagger’s Prometheus-driven analysis detects the regression and automatically aborts the rollout before it reaches full traffic.
Done When
You have completed this module when:
- You can explain the difference between a “Big-Bang” and “Progressive” deployment.
- You have successfully executed a canary deployment with at least 3 traffic steps.
- You have successfully triggered and verified an automated metric-driven rollback.
- You understand how Flagger interacts with Prometheus to gate traffic shifting.