An Argo CD Application describes a source, a destination and the configuration needed to reconcile one deployment. That is easy to follow when a platform has a handful of workloads. As the same add-ons are deployed to more clusters, copying Applications creates repeated configuration and more opportunities for drift.
Helm and ApplicationSet generators solve different parts of that problem. A Helm chart packages Kubernetes templates and defaults. An ApplicationSet generator decides which Applications should exist and supplies the values used to build each one. Together, they let a team standardise the common path while keeping cluster-specific choices visible in Git.
This extends the pattern in our guide to the Argo CD reconciliation loop: Git declares the desired state, and Argo CD reports and reconciles each generated Application.
Keep packaging, targeting and configuration distinct
It helps to make three decisions separately:
- Packaging: Which chart and defaults describe the workload?
- Targeting: Which registered clusters should receive it?
- Configuration: Which values are shared, and which are specific to a cluster or environment?
Argo CD’s Helm integration renders a chart with helm template; Argo CD, rather than Helm, owns the application’s reconciliation lifecycle. An ApplicationSet then uses a generator to create the individual Application resources. This keeps the chart focused on Kubernetes resources and makes the deployment targets explicit. See the Argo CD Helm guide and ApplicationSet generator overview.
Generate only the combinations you intend
A Matrix generator combines the results from two child generators. A useful platform pattern pairs a Git directory generator, which discovers chart directories, with a cluster generator, which selects registered clusters by label. Each combination becomes one Application.
The example below is deliberately synthetic. It assumes a repository containing chart directories under charts/, and that only clusters labelled for managed add-ons should be selected:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: platform-addons
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- matrix:
generators:
- git:
repoURL: https://git.example.invalid/platform/cluster-config.git
revision: main
directories:
- path: charts/*
- clusters:
selector:
matchLabels:
platform.example.invalid/managed-addons: "true"
template:
metadata:
name: '{{ .path.basenameNormalized }}-{{ .nameNormalized }}'
spec:
project: platform-addons
source:
repoURL: https://git.example.invalid/platform/cluster-config.git
targetRevision: main
path: '{{ .path.path }}'
helm:
releaseName: '{{ .path.basenameNormalized }}-{{ .nameNormalized }}'
valueFiles:
- values/common.yaml
- 'values/clusters/{{ .nameNormalized }}.yaml'
ignoreMissingValueFiles: true
destination:
server: '{{ .server }}'
namespace: '{{ .path.basenameNormalized }}'
The Git generator supplies the chart path and its normalised directory name. The cluster generator supplies the registered cluster’s name and API server address. The Matrix generator combines those parameters, so a catalogue of three charts and a selector matching four clusters produces twelve Applications. The Application names remain readable because they include both the chart and cluster.
That multiplication is also the main risk. A Matrix generator creates every combination of its child outputs; it cannot infer that a particular chart belongs only on a subset of clusters. Keep the cluster selector narrow, and add a more specific targeting model when different charts have different eligibility rules. The Matrix generator documentation describes the combination behaviour and its constraints.
The platform-addons project in the example should be an Argo CD AppProject restricted to the approved source repositories, destination clusters and namespaces. missingkey=error makes absent template parameters fail generation instead of silently producing a malformed name or destination. These guardrails keep a reusable template from becoming an unrestricted deployment mechanism.
Use Helm values for intentional variation
Keep chart defaults in values.yaml, put broadly shared settings in values/common.yaml, and add a cluster override only when there is a real difference. In the example, a missing cluster override is ignored because it is optional. If every target must have an override, remove ignoreMissingValueFiles so a missing file is surfaced as an error.
When more than one values file is listed, the later file takes precedence for keys it defines. That makes the cluster file a concise override while retaining all other shared values. Keep this order visible and review it as part of a change. The Helm values documentation explains the merge behaviour and the handling of missing optional files.
Do not put credentials or other secrets in ordinary Helm values files. Reference a secret-management mechanism and grant each generated Application access only to the resources it needs.
Make changes easy to review and operate
This pattern works well when the generated result is predictable:
- Make onboarding explicit. A new chart directory and an opt-in cluster label should be deliberate, reviewable changes.
- Keep names stable and unique. Include enough of the chart and destination identity to distinguish Applications without relying on fragile ordering.
- Control revisions. Use a protected branch or a pinned commit or tag according to how changes are promoted. Avoid allowing an unreviewed chart or values update to flow into production by accident.
- Choose deletion behaviour deliberately. Removing a directory or changing a selector can remove generated Applications. Review the ApplicationSet deletion and resource-pruning policy before enabling automatic pruning.
- Inspect generated Applications. Confirm the source, destination, values and sync policy for representative charts and clusters before broadening the selector.
For a small fleet, a hand-written Application can be clearer than an ApplicationSet. Generators pay off when the same structure repeats and the intended combinations can be expressed with a small, understandable set of rules. Used that way, Helm reduces chart duplication, generators reduce repetitive Application definitions, and Git preserves the review trail for both.
