Introduction
The ApplicationSet controller is a Kubernetes controller that adds support for anApplicationSet CustomResourceDefinition (CRD). This controller enables both automation and greater flexibility when managing Argo CD Applications across a large number of clusters and within monorepos, plus it makes self-service usage possible on multitenant Kubernetes clusters.
Starting with Argo CD v2.3, the ApplicationSet controller is bundled with Argo CD.
- The ability to use a single Kubernetes manifest to target multiple Kubernetes clusters with Argo CD
- The ability to use a single Kubernetes manifest to deploy multiple applications from one or multiple Git repositories
- Improved support for monorepos: multiple Argo CD Application resources defined within a single Git repository
- Within multitenant clusters, improved ability of individual cluster tenants to deploy applications using Argo CD (without needing privileged cluster administrator involvement)
The ApplicationSet Resource
Here’s an example ApplicationSet that deploys a guestbook application to multiple clusters:How It Works
Generate Parameters
The ApplicationSet controller processes the generator entries, producing a set of template parameters.
Substitute into Template
These parameters are substituted into the template, once for each set of parameters.
Create Applications
Each rendered template is converted into an Argo CD Application resource, which is then created (or updated) within the Argo CD namespace.
Generated Applications
With the three clusters defined in the example above, the ApplicationSet controller will generate three Argo CD Applications:Automatic Updates
The ApplicationSet controller ensures that any changes, updates, or deletions made to ApplicationSet resources are automatically applied to the corresponding Applications.If a new cluster/URL entry is added to the List generator, a new Argo CD Application resource will be automatically created for this cluster.
Parameter Substitution
Generators produce parameters, which are key-value pairs that are substituted into thetemplate: section during rendering.
In the example above:
- The List generator defines
clusterandurlparameters - These are substituted into
{{.cluster}}and{{.url}}template values - Each set of parameters produces one Application
Available Generators
Multiple generator types are supported by the ApplicationSet controller:List Generator
Fixed list of cluster name/URL values
Cluster Generator
Automatically uses clusters defined in Argo CD
Git Generator
Parameters from files or directories in Git
Matrix Generator
Combines parameters from two generators
Merge Generator
Merges parameters from multiple generators
SCM Provider
Discovers repositories in GitHub/GitLab organizations
Pull Request
Discovers open pull requests
Cluster Decision Resource
Uses custom resources for cluster selection
Next Steps
Generators
Learn about different generator types and their configuration
Use Cases
Explore common patterns like multi-cluster deployments and monorepos
Security
Understand security considerations for ApplicationSets