You've deployed applications to Kubernetes using ArgoCD. That works for many scenarios, but you've faced a critical limitation: all-or-nothing deployments. When you apply a new Deployment, Kubernetes rolls out the new version to all replicas at once. If there's a bug in that new version, all users see it. You've swapped a working version for a broken one in seconds.
In production, this is unacceptable. You need progressive delivery—the ability to deploy new versions safely by rolling them out gradually, watching them carefully, and rolling back if problems appear.
This chapter introduces two complementary approaches to progressive delivery: canary deployments (gradually shift traffic to new version) and blue-green deployments (run both versions, switch all traffic instantly). We'll then introduce Argo Rollouts, the Kubernetes-native tool that automates these patterns.
By the end of this chapter, you'll understand why AI agents especially benefit from progressive delivery (behavior changes are subtle), the mechanics of canary vs blue-green strategies, and how Argo Rollouts implements them.
Before we dive into mechanics, let's establish why progressive delivery is non-negotiable for AI-powered services.
When you deploy a new version of your FastAPI agent with a standard Kubernetes Deployment:
Output:
Kubernetes replaces old pods with new ones gradually (rolling update). But here's the problem: the entire system is running v2.0 within minutes. If v2.0 has a subtle bug—maybe it incorrectly calculates priorities, or misses edge cases in task decomposition—every single user-facing request encounters that bug.
For traditional services (static content, CRUD APIs), this is manageable. You monitor error rates, and if something breaks, you rollback.
For AI agents, this is catastrophic.
AI agent behavior changes are fundamentally different from traditional software bugs.
Traditional bug: "Function throws exception when input is null"
Agent behavior change: "New prompt template makes agent more aggressive in scheduling tasks"
With all-or-nothing deployments, you can't distinguish between:
Progressive delivery solves this by allowing gradual, observable rollouts where you can:
This is especially critical for agent behavior because the failures are:
Progressive delivery lets you catch these before they reach everyone.
There are two main strategies for safely deploying new versions: canary and blue-green. They solve the same problem but with different tradeoffs.
Concept: Deploy the new version alongside the old version, then gradually shift traffic from old to new. Monitor metrics at each step. If something goes wrong, rollback by returning all traffic to the old version.
Visual model:
Process:
Example timeline for a 5-step canary:
If something goes wrong:
Advantages:
Disadvantages:
Concept: Run two complete versions of your application (blue and green). All traffic currently goes to blue. Deploy green with the new version, fully test it, then switch ALL traffic to green instantly. If green has problems, switch back to blue.
Visual model:
Process:
Example timeline for blue-green:
If something goes wrong:
Advantages:
Disadvantages:
There's no universal "better" strategy. The choice depends on your constraints:
For AI agents, canary deployments are often superior because:
Now that you understand the concepts, let's introduce the tool: Argo Rollouts.
Argo Rollouts is a Kubernetes controller that automates progressive delivery. Instead of writing your own canary/blue-green logic, you declare a Rollout resource (similar to Deployment) with a strategy (canary or blue-green) and steps (traffic percentages, timing, analysis).
Argo Rollouts then:
Basic structure:
Output:
When you apply this Rollout:
Argo Rollouts takes over:
If analysis fails at any step:
You can immediately rollback:
And Argo Rollouts returns all traffic to the previous version.
Let's map the Rollout resource to the concepts you know:
Deployment vs Rollout (conceptual comparison):
Output:
Output:
Key differences:
You might be wondering: "I'm already using ArgoCD to deploy applications. How does Argo Rollouts fit in?"
ArgoCD deploys resources to Kubernetes. Argo Rollouts is a resource that ArgoCD can deploy.
The architecture looks like:
Example workflow:
You commit a new version to Git:
GitHub Actions CI/CD pipeline runs:
ArgoCD detects Git change:
ArgoCD syncs (applies rollout.yaml):
Argo Rollouts controller takes over:
This is the GitOps + Progressive Delivery integration: Git is your source of truth, ArgoCD keeps the cluster in sync with Git, and Argo Rollouts automates safe deployment strategies.
Now let's see how each strategy looks as a Rollout resource.
Output:
Output:
Setup: Open your agent repository in your editor. You'll work with Argo Rollouts concepts.
Prompt 1 - Understanding Your Current Risk
Ask AI: "I currently deploy my FastAPI agent using a standard Kubernetes Deployment with RollingUpdate strategy. Explain what happens if the new version has a subtle bug in task prioritization logic—how quickly will all users see it, and what's my rollback process?"
Prompt 2 - Canary vs Blue-Green Decision
Ask AI: "My agent processes user requests in isolation (no session state). For deploying a new agent version with improved prompt templates, should I use canary or blue-green strategy? Explain the tradeoffs for my use case."
Prompt 3 - Translating Concepts to Manifests
Ask AI: "Show me a Rollout manifest for a canary deployment of an agent with 3 replicas. The canary should shift traffic: 20% for 5m → 50% for 5m → 100%. Include a simple success metric (error rate should stay below 1%)."
You built a gitops-deployment skill in Chapter 0. Test and improve it based on what you learned.
Ask yourself:
If you found gaps: