You've mastered individual Application CRDs in Chapters 8-10. Now you face a new scale: deploy your agent to multiple environments. You need the same Helm chart deployed to dev, staging, and production with different values for each. Or you need to deploy across 5 Kubernetes clusters. Or you need matrix combinations: 3 environments × 2 regions = 6 deployments.
Manually creating 6 Applications with near-identical YAML wastes time and violates DRY principle. ApplicationSets solve this by generating Applications from a single template, using generators that parameterize for different environments, clusters, or combinations.
An ApplicationSet is a Kubernetes CRD that says: "Create multiple Applications automatically based on these parameters."
An ApplicationSet has a structure parallel to Application, but focused on generating rather than deploying:
Output:
Key concept: The template is a standard Application spec, but with {{.paramName}} placeholders. The generators fill those placeholders, creating N Applications from one template.
ApplicationSet supports four main generators. Each answers a different scaling question:
You'll learn each one through practical examples with your Module 6 agent.
The List generator creates one Application per item in a list. Each list item is a dictionary that populates template placeholders.
Your agent needs three environments with different configurations:
Instead of three separate Applications, one ApplicationSet with List generator creates all three.
Output:
ArgoCD created three Applications automatically from one ApplicationSet template. Each has different parameters:
Updating all three: If you change the Helm chart, all three automatically re-sync without touching the ApplicationSet.
The Cluster generator creates one Application per cluster registered in ArgoCD. It's perfect for deploying to multiple Kubernetes clusters without maintaining separate ApplicationSets.
Your organization has three clusters:
One ApplicationSet deploys your agent to all three.
Before creating the ApplicationSet, clusters must be registered:
Output:
Setup: Label clusters for ApplicationSet selection:
Output when applied:
Three Applications created, one per registered cluster. Each deploys to its cluster server without duplicating the ApplicationSet.
The Matrix generator combines two generators to create the Cartesian product. Perfect for deploying across environments AND regions.
Your agent needs deployment across:
That's 2 × 2 = 4 combinations, each with different configuration.
Output when applied:
Matrix generated four Applications from two lists. Each combination has its own namespace and parameters. Update the generators, and ArgoCD maintains all four without separate ApplicationSet edits.
The Git generator discovers Applications from directory structure in your Git repository. It automatically creates Applications for every directory matching a pattern.
Your repository structure:
The Git generator discovers all three environment directories and creates Applications automatically.
Output when applied (ArgoCD scans the repo, discovers directories):
Advantage: Add a new environment directory in Git, and ArgoCD automatically creates a new Application. No ApplicationSet edits needed—pure GitOps.
Here's a production-ready ApplicationSet for your FastAPI agent across three environments:
Output:
Sometimes you need more than just value changes—different templates or resource sets per environment. Use the goTemplate or goText in ApplicationSet for advanced templating.
In your Helm chart's values.yaml:
Output:
Dev deploys without PDB (fast iteration). Prod deploys with PDB (HA protection). No ApplicationSet changes—Helm templating handles it.
Before syncing your ApplicationSet, verify:
Output: All validation checks pass: ApplicationSet created 3 Applications, each synced and healthy, with correct environment-specific parameters.
Part 1: Generate ApplicationSet from Requirements
You need to deploy your agent across: dev (1 replica, debug), staging (2 replicas, warnings only), prod (3 replicas, errors only).
Ask AI: "Create an ApplicationSet that deploys my FastAPI agent to three environments: dev with 1 replica and DEBUG logging, staging with 2 replicas and INFO logging, prod with 3 replicas and ERROR logging. Each environment should be in its own namespace (agent-dev, agent-staging, agent-prod). Use the Helm chart at path 'helm/agent' in the repository."
Part 2: Critical Evaluation
Review AI's response:
Part 3: Environment-Specific Adjustment
Based on your evaluation, refine: "In production, I need PodDisruptionBudget and stricter resource requests (4 CPU, 4Gi memory). In dev, allow unlimited resources. How would you modify the ApplicationSet to support this without duplicating the template?"
Part 4: Validation
Ask AI: "Generate a kubectl commands sequence that applies this ApplicationSet and verifies all three Applications were created with correct parameters."
You built a gitops-deployment skill in Chapter 0. Test and improve it based on what you learned.
Ask yourself:
If you found gaps: