Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/argoproj/argo-cd/llms.txt

Use this file to discover all available pages before exploring further.

The argocd appset command manages ApplicationSets, which enable you to use templating to automatically generate multiple Argo CD applications.

Quick Examples

# Get an ApplicationSet
argocd appset get my-appset

# List all ApplicationSets
argocd appset list

# Create an ApplicationSet from a file
argocd appset create appset.yaml

# Delete an ApplicationSet
argocd appset delete my-appset

What are ApplicationSets?

ApplicationSets provide a way to automatically generate Argo CD applications using templates and generators. They’re useful for:
  • Deploying the same application to multiple clusters
  • Managing multi-tenant environments
  • Implementing monorepos with multiple applications
  • Automating application creation from Git repositories

Subcommands

create

Create one or more ApplicationSets from YAML files.
# Create from local file
argocd appset create applicationset.yaml

# Create from URL
argocd appset create https://raw.githubusercontent.com/example/repo/main/appset.yaml

# Create from stdin
cat applicationset.yaml | argocd appset create -

# Create multiple ApplicationSets
argocd appset create appset1.yaml appset2.yaml appset3.yaml
Example ApplicationSet:
applicationset.yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: cluster-addons
  namespace: argocd
spec:
  generators:
  - list:
      elements:
      - cluster: engineering-dev
        url: https://kubernetes.default.svc
      - cluster: engineering-prod
        url: https://prod-cluster.example.com
  template:
    metadata:
      name: '{{cluster}}-guestbook'
    spec:
      project: default
      source:
        repoURL: https://github.com/argoproj/argocd-example-apps
        targetRevision: HEAD
        path: guestbook
      destination:
        server: '{{url}}'
        namespace: guestbook
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
Key Flags:
--upsert
boolean
Update the ApplicationSet if it already exists
--validate
boolean
default:"true"
Validate the ApplicationSet before creating

list

List all ApplicationSets.
# List all ApplicationSets
argocd appset list

# List with output format
argocd appset list -o json
argocd appset list -o yaml
argocd appset list -o wide

# Filter by project
argocd appset list -p my-project
Output:
NAME             PROJECT  SYNCPOLICY  CONDITIONS
cluster-addons   default  Automated   <none>
git-generator    default  Manual      <none>
matrix-example   default  Automated   <none>

get

Get ApplicationSet details.
# Get ApplicationSet details
argocd appset get my-appset

# Get with YAML output
argocd appset get my-appset -o yaml

# Get with JSON output
argocd appset get my-appset -o json
Output:
Name:         cluster-addons
Project:      default
SyncPolicy:   Automated (Prune)
Conditions:   <none>

Generators:
  List Generator:
    Elements:
    - cluster: engineering-dev
      url: https://kubernetes.default.svc
    - cluster: engineering-prod
      url: https://prod-cluster.example.com

Applications:
  engineering-dev-guestbook:
    Status:  Synced
    Health:  Healthy
  engineering-prod-guestbook:
    Status:  Synced
    Health:  Healthy

delete

Delete one or more ApplicationSets.
# Delete single ApplicationSet
argocd appset delete my-appset

# Delete multiple ApplicationSets
argocd appset delete appset1 appset2 appset3

# Delete without confirmation
argocd appset delete my-appset --yes
Deleting an ApplicationSet will also delete all applications generated by it.
Key Flags:
--yes
boolean
Skip confirmation prompt

generate

Generate and render ApplicationSet templates without creating applications.
# Generate applications from ApplicationSet
argocd appset generate my-appset

# Generate with output format
argocd appset generate my-appset -o yaml

# Generate from file
argocd appset generate --file applicationset.yaml
This is useful for testing and debugging ApplicationSet templates before creating them. Output:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: engineering-dev-guestbook
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps
    path: guestbook
    targetRevision: HEAD
  destination:
    server: https://kubernetes.default.svc
    namespace: guestbook
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: engineering-prod-guestbook
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps
    path: guestbook
    targetRevision: HEAD
  destination:
    server: https://prod-cluster.example.com
    namespace: guestbook

ApplicationSet Generators

List Generator

Generate applications from a static list of parameters:
generators:
- list:
    elements:
    - cluster: dev
      url: https://dev.example.com
    - cluster: prod
      url: https://prod.example.com

Git Generator

Generate applications from Git repository structure:
generators:
- git:
    repoURL: https://github.com/example/repo
    revision: HEAD
    directories:
    - path: apps/*

Cluster Generator

Generate applications for all registered clusters:
generators:
- clusters:
    selector:
      matchLabels:
        environment: production

Matrix Generator

Combine multiple generators:
generators:
- matrix:
    generators:
    - git:
        repoURL: https://github.com/example/apps
        directories:
        - path: apps/*
    - clusters:
        selector:
          matchLabels:
            environment: production

Common Workflows

Multi-Cluster Deployment

multi-cluster-appset.yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: multi-cluster-app
spec:
  generators:
  - clusters:
      selector:
        matchLabels:
          deploy: "true"
  template:
    metadata:
      name: '{{name}}-myapp'
    spec:
      project: default
      source:
        repoURL: https://github.com/example/myapp
        targetRevision: HEAD
        path: manifests
      destination:
        server: '{{server}}'
        namespace: myapp
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
Create the ApplicationSet:
argocd appset create multi-cluster-appset.yaml

Monorepo with Multiple Apps

monorepo-appset.yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: monorepo-apps
spec:
  generators:
  - git:
      repoURL: https://github.com/example/monorepo
      revision: HEAD
      directories:
      - path: apps/*
  template:
    metadata:
      name: '{{path.basename}}'
    spec:
      project: default
      source:
        repoURL: https://github.com/example/monorepo
        targetRevision: HEAD
        path: '{{path}}'
      destination:
        server: https://kubernetes.default.svc
        namespace: '{{path.basename}}'
      syncPolicy:
        automated: {}

Testing ApplicationSet Templates

# Generate without creating
argocd appset generate --file my-appset.yaml

# Validate the output
argocd appset generate --file my-appset.yaml | kubectl apply --dry-run=client -f -

# Create after validation
argocd appset create my-appset.yaml

Update ApplicationSet

# Edit the YAML file
vim applicationset.yaml

# Update with upsert
argocd appset create applicationset.yaml --upsert

# Or delete and recreate
argocd appset delete my-appset --yes
argocd appset create applicationset.yaml

Monitoring ApplicationSets

# List all ApplicationSets and their status
argocd appset list -o wide

# Get detailed status
argocd appset get my-appset

# Check generated applications
argocd app list -l argocd.argoproj.io/application-set-name=my-appset

Troubleshooting

Validate Template Rendering

# Use generate to preview applications
argocd appset generate my-appset

# Check for syntax errors
argocd appset generate --file appset.yaml

Check ApplicationSet Status

# Get ApplicationSet details
argocd appset get my-appset -o yaml

# Check conditions
argocd appset get my-appset | grep -A 5 Conditions

Debug Generator Issues

# For Git generators, verify repository access
argocd repo list

# For Cluster generators, verify cluster registration
argocd cluster list

# Check ApplicationSet controller logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-applicationset-controller

Best Practices

  • Use descriptive names for generated applications with template variables
  • Test ApplicationSets with generate before creating them
  • Use labels to organize generated applications
  • Consider using sync waves for ordered deployment
  • Document generator parameters for team members

Next Steps

App Commands

Manage generated applications

Cluster Commands

Register clusters for multi-cluster deployment