Skip to main content

Overview

With generators, the ApplicationSet controller provides powerful tools to automate the templating and modification of Argo CD Applications. Here are the primary use cases that ApplicationSet was designed to support.

Cluster Add-ons

An initial design focus of the ApplicationSet controller was to enable infrastructure teams to automatically create and manage a large set of Argo CD Applications across many clusters as a single unit.

The Problem

Infrastructure teams are responsible for provisioning cluster add-ons to multiple Kubernetes clusters:
  • Cluster add-ons are operators and controllers like:
    • Prometheus operator for metrics
    • Argo Workflows controller for workflow orchestration
    • Cert-manager for certificate management
    • Ingress controllers
  • Scale challenges:
    • Organizations may manage tens, hundreds, or thousands of clusters
    • New clusters are added/modified/removed regularly
    • Different add-ons need to target different cluster subsets (staging vs production)
  • Permission requirements:
    • Installing add-ons requires cluster-level permissions
    • Development teams (cluster tenants) don’t have these permissions
    • Infrastructure/ops teams need automation to scale

The Solution

Cluster add-on diagram The infrastructure team maintains a Git repository with application manifests for cluster add-ons. ApplicationSet automatically deploys these add-ons to target clusters.

Option 1: List Generator

Manually maintain a list of target clusters:
Adding/removing clusters requires manually updating the ApplicationSet’s list elements.
Automatically detect all clusters defined in Argo CD:
Adding/removing a cluster from Argo CD automatically creates/removes the corresponding Application.

Option 3: Git Generator

Most flexible approach using Git as the source of truth: Using files field:
clusters/prod-us-east/config.json:
Using directories field:

Monorepos

In the monorepo use case, cluster administrators manage the entire state of a Kubernetes cluster from a single Git repository.

The Problem

  • Single Git repository contains manifests for multiple applications
  • Changes to the repository should automatically deploy to the cluster
  • Need to avoid creating individual Application resources for each service manually
  • Want GitOps workflow where merging to main triggers deployment

The Solution

Monorepo diagram ApplicationSet automatically discovers applications in the monorepo and creates Application resources for each.

Git Directory Approach

Repository structure:
ApplicationSet:
This creates Applications for argo-workflows, prometheus-operator, cert-manager, api, and worker.

Git Files Approach

Repository structure:
apps/argo-workflows/config.json:
ApplicationSet:

Self-Service Multi-Tenant Deployments

The self-service use case allows developers on multi-tenant Kubernetes clusters to deploy applications without requiring cluster administrator intervention.

The Problem

Developers want to:
  • Deploy multiple applications to a single cluster
  • Deploy to multiple clusters
  • Do so without involving cluster administrators for each deployment
Traditional app-of-apps approach issues:
  • Developers define Argo CD Application resources in Git
  • Admins review/accept via merge requests
  • Security risk: Application spec contains sensitive fields:
    • project - controls permissions
    • cluster - target cluster
    • namespace - target namespace
  • Inadvertent merge could grant excessive permissions

The Solution

ApplicationSet allows admins to restrict sensitive fields while letting developers customize safe fields.

Safe Self-Service Pattern

Repository structure (developer-controlled):
apps/team-a/frontend/config.json:
ApplicationSet (admin-controlled):
Security benefits:
  • Developers can customize: source repo, revision, path
  • Admins control: target cluster, namespace, project
  • Developers cannot escalate privileges
  • Git commits only contain config.json, not full Application specs

Multi-Cluster Self-Service

Extend to multiple clusters using Matrix generator:
This creates Applications for each app config on each cluster: team-a-frontend-staging, team-a-frontend-production, etc.

Multi-Cluster Deployment Patterns

Deploy Different Apps to Different Clusters

Use cluster labels to control which apps deploy where:

Progressive Rollout Across Clusters

Deploy to dev, then staging, then production:

Best Practices

Begin with List or Cluster generators before moving to more complex Git-based generators. This helps you understand the fundamentals.
Enable automated sync with prune and selfHeal for true GitOps:
Use cluster labels extensively for flexible targeting:
  • environment: production/staging/dev
  • region: us-east/us-west/eu
  • tier: frontend/backend/data
Always hard-code project, destination.server, and destination.namespace when allowing developer customization.
When you need to deploy multiple apps to multiple clusters, Matrix generator eliminates duplication.

Next Steps

Generators

Dive deep into each generator type and their configuration options

Security

Understand security implications and access control for ApplicationSets