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

# ApplicationSet Overview

> Introduction to the Argo CD ApplicationSet controller for managing Applications at scale

## Introduction

The ApplicationSet controller is a Kubernetes controller that adds support for an `ApplicationSet` 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.

<Note>
  Starting with Argo CD v2.3, the ApplicationSet controller is bundled with Argo CD.
</Note>

The ApplicationSet controller works alongside an existing Argo CD installation to provide:

* 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)

<Warning>
  Be aware of the [security implications](/applicationset/security) of ApplicationSets before using them.
</Warning>

## The ApplicationSet Resource

Here's an example ApplicationSet that deploys a guestbook application to multiple clusters:

```yaml theme={null}
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: guestbook
spec:
  goTemplate: true
  goTemplateOptions: ["missingkey=error"]
  generators:
  - list:
      elements:
      - cluster: engineering-dev
        url: https://1.2.3.4
      - cluster: engineering-prod
        url: https://2.4.6.8
      - cluster: finance-preprod
        url: https://9.8.7.6
  template:
    metadata:
      name: '{{.cluster}}-guestbook'
    spec:
      project: my-project
      source:
        repoURL: https://github.com/infra-team/cluster-deployments.git
        targetRevision: HEAD
        path: guestbook/{{.cluster}}
      destination:
        server: '{{.url}}'
        namespace: guestbook
```

## How It Works

<Steps>
  <Step title="Generate Parameters">
    The ApplicationSet controller processes the generator entries, producing a set of template parameters.
  </Step>

  <Step title="Substitute into Template">
    These parameters are substituted into the template, once for each set of parameters.
  </Step>

  <Step title="Create Applications">
    Each rendered template is converted into an Argo CD Application resource, which is then created (or updated) within the Argo CD namespace.
  </Step>

  <Step title="Deploy with Argo CD">
    The Argo CD controller is notified of these Application resources and handles the deployment.
  </Step>
</Steps>

## Generated Applications

With the three clusters defined in the example above, the ApplicationSet controller will generate three Argo CD Applications:

<CodeGroup>
  ```yaml engineering-dev theme={null}
  apiVersion: argoproj.io/v1alpha1
  kind: Application
  metadata:
    name: engineering-dev-guestbook
  spec:
    source:
      repoURL: https://github.com/infra-team/cluster-deployments.git
      targetRevision: HEAD
      path: guestbook/engineering-dev
    destination:
      server: https://1.2.3.4
      namespace: guestbook
  ```

  ```yaml engineering-prod theme={null}
  apiVersion: argoproj.io/v1alpha1
  kind: Application
  metadata:
    name: engineering-prod-guestbook
  spec:
    source:
      repoURL: https://github.com/infra-team/cluster-deployments.git
      targetRevision: HEAD
      path: guestbook/engineering-prod
    destination:
      server: https://2.4.6.8
      namespace: guestbook
  ```

  ```yaml finance-preprod theme={null}
  apiVersion: argoproj.io/v1alpha1
  kind: Application
  metadata:
    name: finance-preprod-guestbook
  spec:
    source:
      repoURL: https://github.com/infra-team/cluster-deployments.git
      targetRevision: HEAD
      path: guestbook/finance-preprod
    destination:
      server: https://9.8.7.6
      namespace: guestbook
  ```
</CodeGroup>

## Automatic Updates

The ApplicationSet controller ensures that any changes, updates, or deletions made to ApplicationSet resources are automatically applied to the corresponding Applications.

<Info>
  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.
</Info>

## Parameter Substitution

Generators produce **parameters**, which are key-value pairs that are substituted into the `template:` section during rendering.

In the example above:

* The List generator defines `cluster` and `url` parameters
* 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:

<CardGroup cols={2}>
  <Card title="List Generator" icon="list" href="/applicationset/generators#list-generator">
    Fixed list of cluster name/URL values
  </Card>

  <Card title="Cluster Generator" icon="server" href="/applicationset/generators#cluster-generator">
    Automatically uses clusters defined in Argo CD
  </Card>

  <Card title="Git Generator" icon="git-alt" href="/applicationset/generators#git-generator">
    Parameters from files or directories in Git
  </Card>

  <Card title="Matrix Generator" icon="table-cells" href="/applicationset/generators#matrix-generator">
    Combines parameters from two generators
  </Card>

  <Card title="Merge Generator" icon="code-merge" href="/applicationset/generators#merge-generator">
    Merges parameters from multiple generators
  </Card>

  <Card title="SCM Provider" icon="github" href="/applicationset/generators#scm-provider-generator">
    Discovers repositories in GitHub/GitLab organizations
  </Card>

  <Card title="Pull Request" icon="code-pull-request" href="/applicationset/generators#pull-request-generator">
    Discovers open pull requests
  </Card>

  <Card title="Cluster Decision Resource" icon="cube" href="/applicationset/generators#cluster-decision-resource-generator">
    Uses custom resources for cluster selection
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Generators" icon="gear" href="/applicationset/generators">
    Learn about different generator types and their configuration
  </Card>

  <Card title="Use Cases" icon="lightbulb" href="/applicationset/use-cases">
    Explore common patterns like multi-cluster deployments and monorepos
  </Card>

  <Card title="Security" icon="shield" href="/applicationset/security">
    Understand security considerations for ApplicationSets
  </Card>
</CardGroup>
