Git Generator Patterns
What you'll learn: How to use Git generators in ArgoCD ApplicationSets to automatically create Applications based on your repository's structure, directories, and branches.
What Are Git Generators?
Git generators are templates that scan your Git repository and dynamically create ArgoCD Applications based on what they find. Think of them like a mail-merge for Kubernetes deployments—instead of manually creating an Application for every microservice or environment, the generator detects patterns in your repo and creates Applications automatically.
How Git Generators Work
Git generators examine your repository structure and generate Applications based on:
- Directories: Create an Application for each subdirectory matching a pattern
- Files: Scan for specific files (like
config.json) in multiple locations - Branches: Generate Applications for different Git branches (e.g., dev, staging, prod)
For example, if your repo has:
apps/
service-a/
service-b/
service-c/
A directory-based Git generator automatically creates three Applications—one for each service—without manual configuration.
Common Patterns
Multi-service pattern: Detect all microservices in an apps/ directory and deploy each.
Branch-based environments: Create separate Applications for main, staging, and dev branches, each pointing to different clusters.
Config-driven discovery: Look for app.yaml files across your repo and generate Applications wherever found.
This eliminates repetitive YAML and keeps your deployment configuration DRY (Don't Repeat Yourself). When you add a new service directory or branch, ArgoCD automatically detects it and creates the corresponding Application.
Key Takeaway: Git generators automate Application creation by scanning repository structure, directories, and branches—turning your Git organization into a self-service deployment factory.