> ## 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.

# argocd appset

> Manage Argo CD ApplicationSets for generating multiple applications

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

## Quick Examples

```bash theme={null}
# 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.

```bash theme={null}
# 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:**

```yaml applicationset.yaml theme={null}
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:**

<ParamField path="--upsert" type="boolean">
  Update the ApplicationSet if it already exists
</ParamField>

<ParamField path="--validate" type="boolean" default="true">
  Validate the ApplicationSet before creating
</ParamField>

### list

List all ApplicationSets.

```bash theme={null}
# 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.

```bash theme={null}
# 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:**

```yaml theme={null}
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.

```bash theme={null}
# 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
```

<Warning>
  Deleting an ApplicationSet will also delete all applications generated by it.
</Warning>

**Key Flags:**

<ParamField path="--yes" type="boolean">
  Skip confirmation prompt
</ParamField>

### generate

Generate and render ApplicationSet templates without creating applications.

```bash theme={null}
# 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:**

```yaml theme={null}
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:

```yaml theme={null}
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:

```yaml theme={null}
generators:
- git:
    repoURL: https://github.com/example/repo
    revision: HEAD
    directories:
    - path: apps/*
```

### Cluster Generator

Generate applications for all registered clusters:

```yaml theme={null}
generators:
- clusters:
    selector:
      matchLabels:
        environment: production
```

### Matrix Generator

Combine multiple generators:

```yaml theme={null}
generators:
- matrix:
    generators:
    - git:
        repoURL: https://github.com/example/apps
        directories:
        - path: apps/*
    - clusters:
        selector:
          matchLabels:
            environment: production
```

## Common Workflows

### Multi-Cluster Deployment

```yaml multi-cluster-appset.yaml theme={null}
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:

```bash theme={null}
argocd appset create multi-cluster-appset.yaml
```

### Monorepo with Multiple Apps

```yaml monorepo-appset.yaml theme={null}
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

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# Use generate to preview applications
argocd appset generate my-appset

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

### Check ApplicationSet Status

```bash theme={null}
# Get ApplicationSet details
argocd appset get my-appset -o yaml

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

### Debug Generator Issues

```bash theme={null}
# 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

<Note>
  * 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
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="App Commands" icon="rocket" href="/cli/app">
    Manage generated applications
  </Card>

  <Card title="Cluster Commands" icon="server" href="/cli/cluster">
    Register clusters for multi-cluster deployment
  </Card>
</CardGroup>
