liveBook · Manning

Argo CD application

As explained in Kargo in Action

An Argo CD application is an Argo CD resource that defines an application's desired state, source, destination, and synchronization behavior.

An Argo CD Application points to a GitOps repository path and a Kubernetes destination. After a promotion updates Git, Argo CD syncs that path and reconciles the cluster; Kargo writes the change but does not own the Application. section 3.5 section 3.5.3

Configure one Application per environment, with attention to these fields:

  • Set source.path to the environment overlay that Kargo updates, and destination.namespace to the environment namespace. section 3.5.3
  • Authorize the matching Kargo Stage with the authorized-stage annotation; the project label associates the Application with its Kargo Project. section 3.5.3
  • Automated sync with prune and selfHeal reconciles repository changes and reverts manual cluster changes. section 3.5.3
Listing 3.16 Argo CD Applications for dev, staging, and prod
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: demo-dev
  namespace: argocd                                                  # #1
  annotations:
    kargo.akuity.io/authorized-stage: demo:dev                       # #2
  labels:
    kargo.akuity.io/project: demo                                    # #3
spec:
  project: default
  source:
    repoURL: https://github.com/<your-github-username>/demo-gitops.git   # #4
    targetRevision: main
    path: envs/dev                                                   # #5
  destination:
    server: https://kubernetes.default.svc
    namespace: demo-dev
  syncPolicy:
    automated:                                                       # #6
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

Inspect the dev Application manifest and compare its environment-specific fields with the staging and production Applications. section 3.5.3

Promotion succeeds but the cluster does not change

Check that the Application exists and that its name exactly matches the name in the Stage’s argocd-update step. If it is OutOfSync without reconciling, check Argo CD’s Git repository credentials and connection status. Verify Applications with kubectl get applications -n argocd. section 3.6.3

How Kargo in Action covers it

How deep it goes
Details source, destination, authorization, and sync-policy fields, then gives checks for a failed reconciliation.
Examples
Follows demo-app from development through staging and production, and configures one Application for each environment.
What it assumes
Assumes Kargo is installed and promotion stages and a GitOps repository are available.
What you can do after
Configure an Application per environment and diagnose missing reconciliation by checking its name, existence, and repository access.
How it connects
Links Kargo promotion, GitOps repositories, Kustomize overlays, and Kubernetes namespaces through reconciliation.

Also explained in

Compare how 2 books explain Argo CD application →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kargo in Action. The section links point to the parts of the book it draws on.