Create Multiple Argo CD Applications from a Helm Values Directory Using ApplicationSet List Generator
Automatically create an Argo CD Application for each subdirectory under values/ in a Git repository, so that every environment (e.g., dev, staging, prod) gets its own Helm release using the same chart but its own values file.
22 Nov 2025, 01:22 UTC

Desired outcome
Automatically create an Argo CD Application for each subdirectory under values/ in a Git repository, so that every environment (e.g., dev, staging, prod) gets its own Helm release using the same chart but its own values file.
Prerequisites
- Argo CD version 2.8 or newer installed and accessible via
argocdCLI or UI. - Cluster access with sufficient permissions to create Applications and install Helm releases.
- A Git repository that Argo CD already tracks (the ApplicationSet will be committed to this repo). The repo must contain:
- A
charts/directory with the Helm chart you want to deploy. - A
values/directory with subdirectories named after target environments, each containing avalues.yamlfile (e.g.,values/dev/values.yaml).
- A
- Read access to the repository for the Argo CD instance (so it can list the
values/directory during reconciliation).
Procedure
- Define an ApplicationSet manifest. Save it as
applicationset-values.yamlin the root of the Git repo that Argo CD manages.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: helm-values-appset
namespace: argocd # adjust if your Argo CD instance uses a different namespace
spec:
generators:
- git:
repo: https://github.com/example/helm-values-repo.git
revision: HEAD
directories:
- path: values/*
template:
metadata:
name: '{{path.basename}}' # yields dev, staging, prod
spec:
project: default
source:
repoURL: https://github.com/example/helm-chart-repo.git
targetRevision: HEAD
path: charts/my-chart
helm:
valueFiles:
- {{path}}/values.yaml # points to values/dev/values.yaml etc.
destination:
server: https://kubernetes.default.svc
namespace: '{{path.basename}}' # optional: separate namespace per env
Commit the manifest to the Argo CD managed Git repo and push.
- Commit and push the manifest:
git add applicationset-values.yaml
git commit -m "Add ApplicationSet to generate apps from values/"
git push origin main # adjust branch as needed
- Argo CD reconciles the ApplicationSet and creates individual Applications.
Expected checks
- List generated Applications:
argocd app list --selector argocd.argoproj.io/application-set=helm-values-appset
Each entry should match a subdirectory name under values/ (e.g., dev, staging, prod).
- Verify sync and health:
argocd app get dev --sync
Look for Synced and Healthy in the STATUS and HEALTH columns.
- Confirm Helm release:
helm -n dev list | grep my-chart
or
kubectl get helmrelease -n dev
The release should show the chart version and the values from the corresponding values.yaml.
Recovery options
- If a generated Application fails (e.g., due to a malformed values file), you can delete it and let the ApplicationSet recreate it after fixing the file:
argocd app rm dev # remove the problematic Application
After correcting values/dev/values.yaml, push the change; Argo CD will resync the ApplicationSet and create a new Application.
- To temporarily stop syncing a specific Application without deleting it:
argocd app sync dev --prune # prune removes resources managed by the app if you want a clean stop
Or suspend sync:
argocd app suspend dev
spec.syncPolicy.automated.prune to false).Limitations and practical verification
- The List (or Git) generator requires the repository to be reachable during each ApplicationSet reconciliation. Network interruptions can cause the generator to see an incomplete file list, resulting in missing or stale Applications. Ensure the Argo CD instance has reliable access to the Git server.
- Avoid overly broad glob patterns (e.g.,
values/**) that could match non‑YAML files likeREADME.md. Such entries will be treated as Applications and will likely fail validation because they lack a propervalues.yaml. Keep the pattern specific to directories that contain avalues.yamlfile. - To confirm that the generator is seeing the expected directories, you can temporarily add a debug ApplicationSet that logs the generated names:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: debug-values-appset
namespace: argocd
spec:
generators:
- git:
repo: https://github.com/example/helm-values-repo.git
revision: HEAD
directories:
- path: values/*
template:
metadata:
name: 'debug-{{path.basename}}'
spec:
source:
repoURL: https://github.com/example/empty-repo.git
path: .
destination:
server: https://kubernetes.default.svc
namespace: default
After sync, list the debug Applications; their names will reveal what the generator saw. Remove the debug set once you confirm the list is correct.
Summary
By using an ApplicationSet with a Git (or List) generator that iterates over subdirectories in a values/ folder, you can automate the creation of Argo CD Applications for each environment, each pointing to the same Helm chart but using its own values file. Verify the generated Applications via the Argo CD CLI or UI, check the Helm releases in the target namespaces, and use the provided recovery steps to handle failures or to clean up.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.