Skip to content

Manage the ticketing apps from git

One Argo CD Application, root-app-ticket, watches argocd/apps/ in ticket-iac and also manages itself, so every ticketing app is declared in git. For moving any other manually applied service under Argo CD, see Put a service under ArgoCD management.

Before you start

  • Shell access to ticket-node-1, where you run kubectl, with a checkout of ticket-iac on branch update_queue.
  • Push access to ticket-iac, branch update_queue. Commit messages use Conventional Commits (fix:, feat:).

How the root app is built

File What it holds
argocd/root-app.yaml Two sources: path: argocd/apps (recurse) and path: argocd with directory.include: "root-app.yaml" (manages itself). syncPolicy.automated: {prune: true, selfHeal: true}
argocd/apps/eticket-cms-production.yaml A child app: source overlays/prod, branch update_queue, retry.limit: 5

A new app is one more file in argocd/apps/.

Protect data from prune

Prune deletes anything that is no longer in git. root-app.yaml turns prune on as soon as you apply it, so protect the data objects before the first kubectl apply. overlays/prod/kustomization.yaml has patches that add argocd.argoproj.io/sync-options: Prune=false to:

  • every PersistentVolumeClaim
  • the CloudNativePG Cluster (postgresql.cnpg.io)

Check on ticket-node-1:

kubectl get pvc -A --no-headers | wc -l
kubectl get pvc -A -o yaml | grep -c "Prune=false"

Expected: both numbers are the same. If the second is lower, stop: don't apply the root app until the patches cover every PVC.

Adopt an existing app

  1. Read the live destination namespace of the app, so the child manifest matches it:

    kubectl get application <APP> -n argocd -o yaml | grep -A3 destination
    

    <APP> is the Argo CD app name, for example eticket-cms-production. 2. Write argocd/apps/<APP>.yaml with that namespace, and push it to update_queue. 3. Apply the root app once (only the first time; after that, git is the source of truth):

    kubectl apply -f argocd/root-app.yaml
    

    Expected: application.argoproj.io/root-app-ticket created (or configured). 4. Check every app:

    kubectl get application -n argocd
    

    Expected: every app shows Synced and Healthy. If one shows Unknown, see Fix DNS and sync faults.