argocd-app-deployer

by alekc

Helm chartv1.3.0Verified publisher

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 in deployments. 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 in projects. Sensible wide-open defaults; all fields (sourceRepos, destinations, resource white/blacklists, roles, etc.) are optional.
  • Cluster-scoped extras — anything under .Values.additionalManifests is rendered verbatim (with tpl) 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 additionalManifests uses the root context $ (e.g. {{ $.Values.X }}) — not the {app, globalConfig, fullConfig} context that helmValues uses. 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.*):

KeyTypeBehaviour
argoCD.annotationsmapper-app wins on collision; both contribute
commonLabels / argoCD.labelsmapper-app wins on collision; both contribute
argoCD.finalizerslistper-app replaces global entirely when set
argoCD.helmmapper-app keys win; unset keys inherit global
argoCD.syncPolicy.automatedmapper-app replaces global entirely when set
argoCD.syncPolicy.retrymapper-app replaces global entirely when set
argoCD.syncPolicy.managedNamespaceMetadatamapper-app replaces global entirely when set
argoCD.syncPolicy.syncOptionslistper-app replaces global entirely when set
ignoreDifferenceslistper-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

NameEmailUrl
alekc[email protected]https://blog.alekc.org

Source Code

Values

KeyTypeDefaultDescription
additionalManifestsobject{}List of additional manifests to include
anyResourceGeneratorobject{"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.chartstring"any-resource"Chart name on repoURL.
anyResourceGenerator.repoURLstring"https://charts.alekc.dev"Repo any-resource is pulled from.
anyResourceGenerator.targetRevisionstring"0.2.0"any-resource version. Bump alongside any-resource's own releases.
argoCDobject{"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.annotationsobject{"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.namestring"in-cluster"Default destination cluster name (as registered in ArgoCD).
argoCD.finalizerslist["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.ignoreMissingValueFilesbooltrueIgnore a values file listed in helm.valueFiles that doesn't exist, instead of failing the sync.
argoCD.labelsobject{}Labels merged onto every Application; a per-app commonLabels contributes on top of these (both apply, per-app wins on key collision).
argoCD.namespacestring"argocd"Namespace every Application/AppProject is created in.
argoCD.projectstring"default"Default AppProject an Application belongs to, unless a per-app project overrides it.
commonLabelsobject{}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.
deploymentsobject{}List of deployments. Keep them Alphabetically sorted!!!
failOnEmptyDeploymentsboolfalseFail 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.repoURLstring""Default repoURL for deployments that don't set their own source.repoURL, and the value available to helmValues via tpl's .globalConfig.source.repoURL.
projectsobject{}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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartargocd-app-deployer is pinned at v1.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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