Overview
The ApplicationSet Service API manages ApplicationSet resources, which automatically generate multiple Applications from templates using generators.
Base Path: /api/v1/applicationsets
gRPC Service: applicationset.ApplicationSetService
ApplicationSet Resource
An ApplicationSet uses generators to create multiple Application resources from a single template.
ApplicationSet Spec
generators
ApplicationSetGenerator[]
required
List of generators that produce parameters for the template Static list of parameter sets
Generate from registered clusters
Generate from Git repository contents
Combine multiple generators
Merge parameters from multiple generators
Generate from SCM provider (GitHub, GitLab, etc.)
Generate from pull requests
template
ApplicationSetTemplate
required
Template for generating Applications Show ApplicationSetTemplate fields
metadata
ApplicationSetTemplateMeta
Metadata template (name, labels, annotations)
Application spec template
Sync policy for generated applications Show ApplicationSetSyncPolicy fields
preserveResourcesOnDeletion
Keep applications when ApplicationSet is deleted
Sync policy: “create-only”, “create-update”, “create-delete”, “sync”
Progressive rollout strategy Show ApplicationSetStrategy fields
Strategy type (e.g., “RollingSync”)
rollingSync
ApplicationSetRolloutStrategy
Rolling sync configuration with steps
Use Go template syntax instead of fasttemplate (default: false)
Example ApplicationSet
apiVersion : argoproj.io/v1alpha1
kind : ApplicationSet
metadata :
name : guestbook-clusters
namespace : argocd
spec :
generators :
- clusters :
selector :
matchLabels :
env : production
template :
metadata :
name : '{{name}}-guestbook'
spec :
project : default
source :
repoURL : https://github.com/argoproj/argocd-example-apps
targetRevision : HEAD
path : guestbook
destination :
server : '{{server}}'
namespace : guestbook
syncPolicy :
automated :
prune : true
selfHeal : true
API Operations
List ApplicationSets
Retrieve a list of ApplicationSets.
GET /api/v1/applicationsets
ApplicationSet namespace (default: argocd control plane namespace)
curl https://argocd-server/api/v1/applicationsets \
-H "Authorization: Bearer $TOKEN "
Get ApplicationSet
Retrieve a specific ApplicationSet.
GET /api/v1/applicationsets/{name}
curl https://argocd-server/api/v1/applicationsets/guestbook-clusters \
-H "Authorization: Bearer $TOKEN "
Create ApplicationSet
Create a new ApplicationSet.
POST /api/v1/applicationsets
Complete ApplicationSet resource
Update if already exists (default: false)
Validate without creating (default: false)
curl -X POST https://argocd-server/api/v1/applicationsets \
-H "Authorization: Bearer $TOKEN " \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"name": "guestbook-clusters"
},
"spec": {
"generators": [
{
"clusters": {
"selector": {
"matchLabels": {
"env": "production"
}
}
}
}
],
"template": {
"metadata": {
"name": "{{name}}-guestbook"
},
"spec": {
"project": "default",
"source": {
"repoURL": "https://github.com/argoproj/argocd-example-apps",
"path": "guestbook",
"targetRevision": "HEAD"
},
"destination": {
"server": "{{server}}",
"namespace": "guestbook"
}
}
}
}
}'
Delete ApplicationSet
Delete an ApplicationSet.
DELETE /api/v1/applicationsets/{name}
curl -X DELETE https://argocd-server/api/v1/applicationsets/guestbook-clusters \
-H "Authorization: Bearer $TOKEN "
Generator Operations
Generate Applications
Preview applications that would be generated by an ApplicationSet.
POST /api/v1/applicationsets/generate
ApplicationSet to evaluate
Example Request:
curl -X POST https://argocd-server/api/v1/applicationsets/generate \
-H "Authorization: Bearer $TOKEN " \
-d '{
"applicationSet": {
"metadata": {"name": "test"},
"spec": {
"generators": [{"list": {"elements": [{"cluster": "prod"}]}}],
"template": {
"metadata": {"name": "{{cluster}}-app"},
"spec": {"project": "default"}
}
}
}
}'
Response:
List of generated Application resources
Monitoring Operations
Get Resource Tree
Get the ApplicationSet’s resource hierarchy.
GET /api/v1/applicationsets/{name}/resource-tree
List Events
List Kubernetes events for the ApplicationSet.
GET /api/v1/applicationsets/{name}/events
Watch ApplicationSets
Stream ApplicationSet change events.
GET /api/v1/stream/applicationsets
Start watching from specific resource version
Generator Examples
List Generator
generators :
- list :
elements :
- cluster : prod
url : https://prod.example.com
- cluster : staging
url : https://staging.example.com
Cluster Generator
generators :
- clusters :
selector :
matchLabels :
env : production
matchExpressions :
- key : region
operator : In
values : [ us-east , us-west ]
Git Directory Generator
generators :
- git :
repoURL : https://github.com/myorg/myrepo
revision : HEAD
directories :
- path : apps/*
Git Files Generator
generators :
- git :
repoURL : https://github.com/myorg/myrepo
revision : HEAD
files :
- path : "configs/*.json"
Matrix Generator
generators :
- matrix :
generators :
- git :
repoURL : https://github.com/myorg/myrepo
directories :
- path : apps/*
- clusters :
selector :
matchLabels :
env : production
SCM Provider Generator
generators :
- scmProvider :
github :
organization : myorg
tokenRef :
secretName : github-token
key : token
filters :
- repositoryMatch : "^app-.*"
Pull Request Generator
generators :
- pullRequest :
github :
owner : myorg
repo : myrepo
tokenRef :
secretName : github-token
key : token
filters :
- branchMatch : "^feature/.*"
Template Variables
Common template variables available in ApplicationSet templates:
Cluster Generator Variables
{{name}} - Cluster name
{{server}} - Cluster API server URL
{{metadata.labels.*}} - Cluster labels
{{metadata.annotations.*}} - Cluster annotations
Git Generator Variables
{{path}} - Directory or file path
{{path.basename}} - Base name of path
{{path.filename}} - File name (files generator)
{{path[n]}} - Path segment at index n
List Generator Variables
All fields from element objects are available as variables.
Progressive Sync
Configure progressive rollout of generated applications:
strategy :
type : RollingSync
rollingSync :
steps :
- matchExpressions :
- key : env
operator : In
values : [ canary ]
maxUpdate : 1
- matchExpressions :
- key : env
operator : In
values : [ production ]
maxUpdate : 25%
Next Steps
Application API Manage generated Applications
Cluster API Register clusters for generators