DevOps Peach

GitOps with Argo CD · Delivering Apps with Argo CD · Lesson 1 of 4

Helm, Kustomize and plain YAML sources

The repo server detects the source type and renders it: a folder of YAML, a Kustomize overlay, or a Helm chart with values files and parameters.

Practice interactively →

Argo CD never runs helm install. The repo server renders the source into plain manifests, and the controller applies them. It picks the tool by looking at the folder:

Folder contains Rendered with
kustomization.yaml Kustomize (kustomize build)
Chart.yaml Helm (helm template)
Only *.yaml / *.json Plain directory (add directory.recurse: true for subfolders)
A plugin config A Config Management Plugin (sidecar)

Kustomize overlays per environment

apps/shop-api/
  base/            deployment.yaml  service.yaml  kustomization.yaml
  overlays/
    dev/           kustomization.yaml   # replicas 1, image tag 1.4.3
    prod/          kustomization.yaml   # replicas 3, image tag 1.4.2, HPA
# overlays/prod/kustomization.yaml
resources: [../../base]
images:
  - name: registry.example.com/shop-api
    newTag: "1.4.2"
replicas:
  - name: shop-api
    count: 3

Each environment is one Application pointing at its overlay path. You can also override a few things on the Application (spec.source.kustomize.images, namePrefix, commonLabels), but keeping them in the overlay keeps Git the single source of truth.

Helm charts

spec:
  source:
    repoURL: https://charts.example.com          # a Helm repo (or oci://registry.example.com/charts)
    chart: shop-api
    targetRevision: 2.3.1                        # chart version
    helm:
      releaseName: shop-api
      valueFiles: [values-prod.yaml]             # only for charts in Git
      valuesObject:
        replicaCount: 3
        image: { tag: "1.4.2" }

Check before you commit

kustomize build apps/shop-api/overlays/prod | less
helm template shop-api charts/shop-api -f charts/shop-api/values-prod.yaml | less
argocd app manifests shop-api-prod          # what Argo CD itself rendered
argocd app create shop-api-prod ... --helm-set image.tag=1.4.2   # parameters from the CLI (avoid in GitOps)

Rule: parameters set with argocd app set --helm-set live only in the Application object. Prefer values files in Git; if you do use parameters, make sure the Application YAML itself is in Git.

Practice interactively →