Course outline

Argo CD / Generated systems and controlled recovery / Lesson 21

Review ApplicationSet matrix expansion

Predict generated Application combinations and ownership when two ApplicationSet generators are combined.

About 3 min readContent reviewed
On this page

Lesson goals

  • Explain a matrix of generator parameters.
  • Predict generated Application identities and destinations.
  • Review expansion and deletion effects before reconciliation.

Model the expansion

An ApplicationSet generator produces parameters used to render Application templates. A Matrix generator combines outputs from two child generators. In the simple independent example below, two application names and two clusters yield four combinations. Real generators can use parameters from another generator, so calculate the actual output rather than assuming every matrix is an unrestricted Cartesian product.

Predict the generated set

The first record is a synthetic inventory of two names and two lab clusters. Enumerate each expected name and destination before enabling the ApplicationSet. A generated Application is a controller-managed object; a manual edit to it may be overwritten by reconciliation. Review project permissions and destination restrictions for every generated item. The record is not an ApplicationSet manifest and makes no cluster request.

yaml Synthetic matrix inputs
applications: [catalog, worker]
clusters: [lab-east, lab-west]
expected_combinations: 4

Two independent lists of two entries produce four candidate combinations in this example.

Verify identity and uniqueness

The second record represents one expected combination. Ensure the template creates a unique valid Application name and the intended project, source and destination for every combination. Colliding names can prevent the generated set from representing the intended deployments. Record the source revisions and generator inputs so a reviewer can reproduce the result without relying on a friendly cluster label alone.

yaml Synthetic generated item
application: catalog
cluster: lab-east
generated_name: catalog-lab-east
project: training

This is a predicted item, not an Application observed in Argo CD.

Review changes and removal

Adding a cluster or changing a generator filter can create or remove generated Applications. Removal may interact with the ApplicationSet and Application deletion policies and resource finalizers; inspect the installed version and exact policy before changing inputs. A new combination can also target an unintended environment. Do not infer deletion safety from a small preview alone.

Verify in an isolated lab

In an authorized lab, preview or inspect the generated set for synthetic sources and compare every name, project and destination with the expected table. Test an added input and a removed input using disposable resources and reviewed deletion behavior. Record the controller version and evidence. Generation success does not prove the Applications synchronized or that workloads are healthy.

Common errors and fixes

Two lists are assumed to produce only two items

Why it happens
Independent matrix inputs combine into four pairs here.
How to fix it
Enumerate the expected combinations before reconciliation.
Prevent it next time
Review expansion counts and destinations.

A generated child is edited as the durable source

Why it happens
The ApplicationSet may regenerate it from its template.
How to fix it
Update the owning generator or template through review.
Prevent it next time
Document ownership of generated Applications.

Removing an input is assumed harmless

Why it happens
Generated Application and resource deletion behavior depends on policy.
How to fix it
Inspect deletion settings and test in a disposable lab.
Prevent it next time
Review additions and removals as change impacts.

2 practice exercises

1. Two independent applications and two clusters are combined. How many candidates exist?

Show worked solution

Four: each application pairs with each cluster, subject to the actual generator configuration.

2. A cluster is removed from the generator. Is workload deletion guaranteed or impossible?

Show worked solution

Neither can be assumed. Inspect ApplicationSet policy, finalizers and installed-version behavior before making the change.

Key takeaways

  • Matrix expansion combines generator parameters.
  • Predict unique identities, destinations and permissions.
  • Generated-object removal needs explicit policy review.

Official references