76.1 Project 40: Canary release with Argo Rollouts
Friends, canary means a small slice of users hit the new version first. Today we write an Argo Rollouts canary with weights 20, 50, 100, learn promote and abort, and compare it to blue-green.
मित्रांनो, canary म्हणजे थोड्या users ना नवीन version. आज Argo Rollouts weights 20/50/100, promote आणि abort, blue-green शी तुलना.
दोस्तों, canary मतलब थोड़े users को नया version. आज Argo Rollouts weights 20/50/100, promote और abort, blue-green से तुलना.
What you will build in this project
- Rollout YAML with canary steps.
- Service for stable name.
- promote and abort commands.
- Notes comparing canary vs blue-green.
1. Start from a real company story
At Paytm in Noida, a full flip of the wallet API broke UPI for four minutes.
Payouts paused. Rough cost: about ₹55 lakh in penalties and support.
Vikram moved wallet releases to Argo Rollouts canaries with an abort drill every week.
Today we practice that canary shape on the lab.
Ravindra Bagale's Tip
Many students only practice happy-path promote. The abort drill is the one that saves Friday nights. Practice abort. Keep that habit.
खूप students फक्त promote practice करतात. Abort drill Friday night वाचवतो. Abort practice करा. सवय ठेवा.
बहुत students सिर्फ promote practice करते हैं. Abort drill Friday night बचाता है. Abort practice करें. आदत रखिए.
2. Start and prepare
Step 1: Why canary
Why: Small slice first. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: why. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 1: a1
Type this:
echo 'Canary sends a small percent of traffic to the new version first'
You will see:
Canary sends a small percent of traffic to the new version first
What it means: Why canary beats big-bang.
Example 2: a2
Type this:
echo 'Argo Rollouts adds a Rollout CRD that can weight traffic with Ingress or Service mesh'
You will see:
Argo Rollouts adds a Rollout CRD that can weight traffic with Ingress or Service mesh
What it means: What Argo Rollouts adds.
Example 3: a3
Type this:
echo 'Lab pattern without mesh: two ReplicaSets and a manual weight via Service subsets tip'
You will see:
Lab pattern without mesh: two ReplicaSets and a manual weight via Service subsets tip
What it means: Laptop-friendly approach.
Step 2: Install tip
Why: Install controller. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: install. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 4: b1
Type this:
echo 'Install tip: apply Argo Rollouts manifests from argo-rollouts.readthedocs.io'
You will see:
Install tip: apply Argo Rollouts manifests from argo-rollouts.readthedocs.io
What it means: Official docs host for install.
Example 5: b2
Type this:
echo 'kubectl create namespace argo-rollouts'
You will see:
kubectl create namespace argo-rollouts
What it means: Namespace for the controller.
Example 6: b3
Type this:
echo 'kubectl get pods -n argo-rollouts'
You will see:
kubectl get pods -n argo-rollouts
What it means: Controller should be Running.
Step 3: Write Rollout YAML
Why: steps with weights. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: printf. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 7: c1
Type this:
mkdir -p /tmp/k8s40 && printf '%s\n' 'apiVersion: argoproj.io/v1alpha1' 'kind: Rollout' 'metadata: {name: shop-canary}' 'spec:' ' replicas: 5' ' strategy:' ' canary:' ' steps:' ' - setWeight: 20' ' - pause: {duration: 30}' ' - setWeight: 50' ' - pause: {duration: 30}' ' - setWeight: 100' ' selector: {matchLabels: {app: shop-canary}}' ' template:' ' metadata: {labels: {app: shop-canary}}' ' spec:' ' containers:' ' - name: web' ' image: nginx:1.27-alpine' ' ports: [{containerPort: 80}]' > /tmp/k8s40/rollout.yaml && grep -A6 'canary:' /tmp/k8s40/rollout.yaml
You will see:
canary:
steps:
- setWeight: 20
What it means: Rollout YAML with 20 then 50 then 100 weights.
Example 8: c2
Type this:
echo 'kubectl apply -f /tmp/k8s40/rollout.yaml'
You will see:
kubectl apply -f /tmp/k8s40/rollout.yaml
What it means: Apply Rollout when CRDs exist.
Example 9: c3
Type this:
echo 'kubectl argo rollouts get rollout shop-canary'
You will see:
kubectl argo rollouts get rollout shop-canary
What it means: CLI status view.
3. Build the main pieces
Step 4: Baseline and image bump
Why: Stable then canary RS. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo bump. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 10: d1
Type this:
echo 'First deploy uses the stable ReplicaSet at 100 percent'
You will see:
First deploy uses the stable ReplicaSet at 100 percent
What it means: Baseline.
Example 11: d2
Type this:
echo 'Image bump creates a canary ReplicaSet at setWeight percent'
You will see:
Image bump creates a canary ReplicaSet at setWeight percent
What it means: Canary Pods appear.
Example 12: d3
Type this:
echo 'kubectl set image rollout/shop-canary web=nginx:1.27-alpine'
You will see:
kubectl set image ... (or kubectl argo rollouts set image)
What it means: Trigger a canary step.
Step 5: pause promote abort
Why: Human gates. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo cmds. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 13: e1
Type this:
echo 'pause steps let humans or analysis decide before more weight'
You will see:
pause steps let humans or analysis decide before more weight
What it means: Why pause.
Example 14: e2
Type this:
echo 'kubectl argo rollouts promote shop-canary'
You will see:
kubectl argo rollouts promote shop-canary
What it means: Continue after pause.
Example 15: e3
Type this:
echo 'kubectl argo rollouts abort shop-canary'
You will see:
kubectl argo rollouts abort shop-canary
What it means: Abort bad canary.
Step 6: Analysis and Ingress tips
Why: Metrics gates. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo analysis. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 16: f1
Type this:
echo 'AnalysisTemplate can fail the canary on error-rate metrics'
You will see:
AnalysisTemplate can fail the canary on error-rate metrics
What it means: Automated gates.
Example 17: f2
Type this:
echo 'Without mesh, use Ingress canary annotations from your controller docs'
You will see:
Without mesh, use Ingress canary annotations from your controller docs
What it means: Ingress weight tip.
Example 18: f3
Type this:
echo 'Never skip the abort path in a drill'
You will see:
Never skip the abort path in a drill
What it means: Drill habit.
4. Automate and verify
Step 7: Service YAML
Why: Stable Service. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: printf svc. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 19: g1
Type this:
printf '%s\n' 'apiVersion: v1' 'kind: Service' 'metadata: {name: shop-canary}' 'spec:' ' selector: {app: shop-canary}' ' ports: [{port: 80}]' > /tmp/k8s40/svc.yaml && cat /tmp/k8s40/svc.yaml
You will see:
kind: Service
...
What it means: Service for the Rollout.
Example 20: g2
Type this:
echo 'kubectl apply -f /tmp/k8s40/svc.yaml'
You will see:
kubectl apply -f /tmp/k8s40/svc.yaml
What it means: Apply Service.
Example 21: g3
Type this:
echo 'Stable Service name keeps clients unchanged during canary'
You will see:
Stable Service name keeps clients unchanged during canary
What it means: Naming habit.
Step 8: Vs blue-green
Why: Compare patterns. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo compare. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 22: h1
Type this:
echo 'Compare: blue-green flips all traffic; canary ramps percent'
You will see:
Compare: blue-green flips all traffic; canary ramps percent
What it means: Vs project 39.
Example 23: h2
Type this:
echo 'Use canary for risky payment paths; blue-green for config flips'
You will see:
Use canary for risky payment paths; blue-green for config flips
What it means: When to pick which.
Example 24: h3
Type this:
echo 'Record error rate before promote in your notebook'
You will see:
Record error rate before promote in your notebook
What it means: Evidence habit.
Step 9: Undo and digests
Why: Undo path. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo undo. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 25: i1
Type this:
echo 'kubectl argo rollouts undo shop-canary'
You will see:
kubectl argo rollouts undo shop-canary
What it means: Undo to previous stable.
Example 26: i2
Type this:
echo 'Rollout history is in the Rollout status object'
You will see:
Rollout history is in the Rollout status object
What it means: Where history lives.
Example 27: i3
Type this:
echo 'Image digests beat floating tags for canary honesty'
You will see:
Image digests beat floating tags for canary honesty
What it means: Tag habit.
5. Harden and accept
Step 10: Plugin and status
Why: CLI plugin. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: echo plugin. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 28: j1
Type this:
echo 'Kind lab: install plugin kubectl-argo-rollouts for the CLI subcommand'
You will see:
Kind lab: install plugin kubectl-argo-rollouts for the CLI subcommand
What it means: Plugin tip.
Example 29: j2
Type this:
echo 'If CRDs missing, the apply will fail until the controller is installed'
You will see:
If CRDs missing, the apply will fail until the controller is installed
What it means: Failure mode.
Example 30: j3
Type this:
echo 'Read the Rollout status.phase field after each step'
You will see:
Read the Rollout status.phase field after each step
What it means: Status habit.
Step 11: Cleanup
Why: Cleanup. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: cleanup. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 31: k1
Type this:
echo 'Optional cleanup: kubectl delete rollout shop-canary svc shop-canary'
You will see:
Optional cleanup: kubectl delete rollout shop-canary svc shop-canary
What it means: Cleanup.
Example 32: k2
Type this:
echo 'Keep notes of setWeight values that felt safe in the drill'
You will see:
Keep notes of setWeight values that felt safe in the drill
What it means: Tune tip.
Example 33: k3
Type this:
echo 'Next project packages this app as a Helm chart'
You will see:
Next project packages this app as a Helm chart
What it means: Bridge.
Step 12: Acceptance checklist
Why: Vikram signs off. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.
What: All green. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.
Example 34: z1
Type this:
echo 'Canary steps include setWeight 20 then 50 then 100'
You will see:
Canary steps include setWeight 20 then 50 then 100
What it means: Checklist weights.
Example 35: z2
Type this:
echo 'Abort command practiced: kubectl argo rollouts abort'
You will see:
Abort command practiced: kubectl argo rollouts abort
What it means: Checklist abort.
Example 36: z3
Type this:
echo 'Vikram: PASS'
You will see:
Vikram: PASS
What it means: Project 40 accepted.
Check yourself
Q1. Who fixed Paytm wallet?
Vikram
Q2. First weight?
20
Q3. CRD kind?
Rollout
Q4. Continue command?
promote
Q5. Stop command?
abort
Q6. Docs host tip?
argo-rollouts.readthedocs.io
Friends, you wrote a weighted canary Rollout and learned promote and abort. Did you understand? Let us try it once more. Add an AnalysisTemplate tip to your notebook for error-rate gates.
मित्रांनो, तुम्ही weighted canary लिहून promote/abort शिकलात. AnalysisTemplate tip लिहा.
दोस्तों, आपने weighted canary लिख promote/abort सीखा. AnalysisTemplate tip लिखें.
Lab: try at home
- Install Argo Rollouts from official docs.
- Write Rollout with canary steps.
- Apply Service.
- Practice promote and abort.
- Compare to blue-green.
Recap
- Weights ramp risk slowly.
- pause is for humans or analysis.
- abort is mandatory in drills.
- Stable Service name.
- Digests beat floating tags.