argocd-app-deployer
by alekc
Renders ArgoCD Application and AppProject resources from declarative values, an app-of-apps generator for GitOps-driven clusters.
About this chart
argocd-app-deployer
What this chart does
argocd-app-deployer is an opinionated ArgoCD app-of-apps generator. Instead of authoring
one Application (and optional AppProject) manifest per workload, you describe the whole
desired set of Argo Applications declaratively under .Values.deployments and let this chart
render them.
It produces three kinds of resource:
argoproj.io/Application— one per entry indeployments. Each entry can pick a helm chart, git path, or multi-source layout, with first-class support for per-app overrides on finalizers, sync policy, ignore-differences, annotations, labels, and helm values.argoproj.io/AppProject— one per entry inprojects. Sensible wide-open defaults; all fields (sourceRepos,destinations, resource white/blacklists,roles, etc.) are optional.- Cluster-scoped extras — anything under
.Values.additionalManifestsis rendered verbatim (withtpl) as ordinary Kubernetes manifests, useful for things like ConfigMaps the parent Application itself needs.
The intended deployment topology is:
┌────────────────────────────┐
│ bootstrap Argo Application│ ← you create this once (terraform / kubectl apply)
│ source.chart = argocd-app-deployer
└────────────┬───────────────┘
│
▼
┌────────────────────────────┐
│ N child Applications │ ← rendered by this chart
│ (one per .Values.deployments entry)
└────────────────────────────┘
Installing the chart
helm repo add alekc-charts https://charts.alekc.dev
helm install my-release alekc-charts/argocd-app-deployer -f my-values.yaml
Or directly from the OCI registry, no helm repo add needed:
helm install my-release oci://charts.alekc.dev/argocd-app-deployer --version 1.3.0 -f my-values.yaml
In practice you'll wrap it in a single ArgoCD Application (the "bootstrap" / orchestrator
app) whose source.chart: argocd-app-deployer and whose values reference one or more values
files from your config repo via the multi-source pattern.
Verifying the signature
curl -sO https://charts.alekc.dev/pubring.gpg
helm pull oci://charts.alekc.dev/argocd-app-deployer --version 1.3.0 --verify --keyring pubring.gpg
Usage patterns
1. Deploy a public Helm chart
deployments:
cert-manager:
name: cert-manager
namespace: cert-manager
source:
chart: cert-manager
repoURL: https://charts.jetstack.io
targetRevision: "v1.20.*"
helmValues:
installCRDs: true
helmValues is rendered through tpl with a context of {app, globalConfig, fullConfig}, so
you can reference other parts of your config: {{ .app.namespace }}, {{ .globalConfig.foo }},
or {{ .fullConfig.Values.bar }}.
2. Deploy from a Git path (Kustomize / plain manifests)
deployments:
my-app:
name: my-app
namespace: my-app
source:
type: git # disables the helm: block
path: clusters/prod/my-app
repoURL: [email protected]:org/repo.git
targetRevision: main
3. Multi-source: chart + external values
deployments:
grafana:
name: grafana
namespace: monitoring
source:
chart: grafana
repoURL: https://grafana.github.io/helm-charts
targetRevision: "9.*.*"
additionalSources:
- ref: config
repoURL: [email protected]:org/repo.git
targetRevision: main
4. Add cluster-scoped resources alongside the Application
additionalManifests are rendered through a separate Argo source (the
any-resource chart) so they share the Application's lifecycle:
deployments:
my-app:
name: my-app
namespace: my-app
source: { chart: my-app, repoURL: oci://..., targetRevision: "1.0.0" }
additionalManifests:
pvc-data:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-app-data
namespace: my-app
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 10Gi
Note: templating inside
additionalManifestsuses the root context$(e.g.{{ $.Values.X }}) — not the{app, globalConfig, fullConfig}context thathelmValuesuses. They render through different argo sources.
5. Per-app overrides — finalizers, sync policy, helm, ignore-differences
deployments:
longhorn:
name: longhorn
namespace: longhorn-system
argoCD:
finalizers: # REPLACE — see merge semantics below
- resources-finalizer.argocd.argoproj.io
- pre-delete-finalizer.argocd.argoproj.io
- pre-delete-finalizer.argocd.argoproj.io/cleanup
syncPolicy:
automated:
selfHeal: false # MERGE — only this key overrides default
helm:
valueFiles:
- values-prod.yaml
ignoreDifferences: # REPLACE — see merge semantics below
- kind: "*"
group: apiextensions.k8s.io
jsonPointers:
- /metadata/labels
source:
chart: longhorn
repoURL: https://charts.longhorn.io
targetRevision: "1.10.*"
6. Define an AppProject (scoped or wide-open)
projects:
default:
name: default
# no overrides → wide-open: sourceRepos ['*'], destinations ['*' in-cluster],
# both resource whitelists ['*' '*'].
prod:
name: prod
description: Production workloads only
sourceRepos:
- https://gitlab.com/my-org/*
destinations:
- namespace: prod-*
name: in-cluster
namespaceResourceBlacklist:
- group: ""
kind: ResourceQuota
roles:
- name: read-only
policies:
- p, proj:prod:read-only, applications, get, prod/*, allow
7. Sync ordering
Use wave: to push an app earlier or later in the orchestrator's sync waves:
deployments:
longhorn:
name: longhorn
wave: 10 # earlier — storage before workloads
my-app:
name: my-app
wave: 100 # later
If you'd rather pin the wave via raw annotation (argocd.argoproj.io/sync-wave), you can —
it's preserved when wave is not explicitly set on the app.
Merge semantics — important
When a value can be set both globally (.Values.argoCD.*) and per-app (deployments.<name>.argoCD.*):
| Key | Type | Behaviour |
|---|---|---|
argoCD.annotations | map | per-app wins on collision; both contribute |
commonLabels / argoCD.labels | map | per-app wins on collision; both contribute |
argoCD.finalizers | list | per-app replaces global entirely when set |
argoCD.helm | map | per-app keys win; unset keys inherit global |
argoCD.syncPolicy.automated | map | per-app replaces global entirely when set |
argoCD.syncPolicy.retry | map | per-app replaces global entirely when set |
argoCD.syncPolicy.managedNamespaceMetadata | map | per-app replaces global entirely when set |
argoCD.syncPolicy.syncOptions | list | per-app replaces global entirely when set |
ignoreDifferences | list | per-app replaces global entirely when set |
If a per-app replace-type field is declared, re-include the global defaults you still
want — they are not appended.
Maintainers
| Name | Url | |
|---|---|---|
| alekc | [email protected] | https://blog.alekc.org |
Source Code
Values
| Key | Type | Default | Description |
|---|---|---|---|
| additionalManifests | object | {} | List of additional manifests to include |
| anyResourceGenerator | object | {"chart":"any-resource","repoURL":"https://charts.alekc.dev","targetRevision":"0.2.0"} | The any-resource chart used as a second Argo source to render each deployment's own additionalManifests, so those manifests share the parent Application's lifecycle. See the README's usage pattern 4. |
| anyResourceGenerator.chart | string | "any-resource" | Chart name on repoURL. |
| anyResourceGenerator.repoURL | string | "https://charts.alekc.dev" | Repo any-resource is pulled from. |
| anyResourceGenerator.targetRevision | string | "0.2.0" | any-resource version. Bump alongside any-resource's own releases. |
| argoCD | object | {"annotations":{"argocd.argoproj.io/manifest-generate-paths":"."},"destination":{"name":"in-cluster"},"finalizers":["resources-finalizer.argocd.argoproj.io"],"helm":{"ignoreMissingValueFiles":true,"valueFiles":["values.yaml"]},"ignoreDifferences":[{"group":"admissionregistration.k8s.io","jqPathExpressions":[".webhooks[]?.clientConfig.caBundle"],"kind":"*"}],"labels":{},"namespace":"argocd","project":"default","syncPolicy":{"automated":{"prune":true,"selfHeal":true},"managedNamespaceMetadata":{},"retry":{"backoff":{"duration":"5s","factor":2,"maxDuration":"5m0s"},"limit":-1},"syncOptions":["CreateNamespace=true","ApplyOutOfSyncOnly=true","RespectIgnoreDifferences=true","ServerSideApply=true"]}} | These are default argoCD values based on best practises |
| argoCD.annotations | object | {"argocd.argoproj.io/manifest-generate-paths":"."} | Annotations merged onto every Application; a per-app argoCD.annotations contributes on top of these (both apply, per-app wins on key collision). |
| argoCD.destination.name | string | "in-cluster" | Default destination cluster name (as registered in ArgoCD). |
| argoCD.finalizers | list | ["resources-finalizer.argocd.argoproj.io"] | Finalizers on every Application, unless a per-app argoCD.finalizers replaces them (see Merge semantics in the README). |
| argoCD.helm.ignoreMissingValueFiles | bool | true | Ignore a values file listed in helm.valueFiles that doesn't exist, instead of failing the sync. |
| argoCD.labels | object | {} | Labels merged onto every Application; a per-app commonLabels contributes on top of these (both apply, per-app wins on key collision). |
| argoCD.namespace | string | "argocd" | Namespace every Application/AppProject is created in. |
| argoCD.project | string | "default" | Default AppProject an Application belongs to, unless a per-app project overrides it. |
| commonLabels | object | {} | Labels merged onto every rendered Application/AppProject, see the README's Merge semantics section for how this interacts with argoCD.labels and a per-app commonLabels override. |
| deployments | object | {} | List of deployments. Keep them Alphabetically sorted!!! |
| failOnEmptyDeployments | bool | false | Fail the render if zero deployments are enabled. Guards against a bare deployments: key in a merged value file nulling the whole map, which would emit an empty Application set and trigger an Argo prune cascade (see ALE-29). Default false so the chart's own deployments: {} lint stays green. Consumers that always ship at least one app should set this true. |
| globalConfig.source.repoURL | string | "" | Default repoURL for deployments that don't set their own source.repoURL, and the value available to helmValues via tpl's .globalConfig.source.repoURL. |
| projects | object | {} | List of projects (rendered as AppProject CRDs). Each entry supports the following optional fields (sensible wide-open defaults if unset): description: string (defaults to "Project for ") sourceRepos: list (defaults to [""]) destinations: list of {namespace, name} (defaults to [{namespace: "", name: argoCD.destination.name}]) clusterResourceWhitelist: list of {group, kind} (defaults to [{group: "", kind: ""}]) namespaceResourceWhitelist: list of {group, kind} (defaults to [{group: "", kind: ""}]) clusterResourceBlacklist: list of {group, kind} (omitted if unset) namespaceResourceBlacklist: list of {group, kind} (omitted if unset) roles: list of role objects (omitted if unset) orphanedResources: object (omitted if unset) |
Deploy argocd-app-deployer with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has argocd-app-deployer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartargocd-app-deployer is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply