Skip to content

Argo CD Application Configuration

Namespace-aware parameter model

Use these parameters so the manifest can be reused for any entity namespace:

  • ENTITY_NAMESPACE: entity scope (example: france-titres)
  • APP_SLUG: app identifier (example: hello-world)
  • ARGO_PROJECT: Argo CD project (commonly same as entity namespace)
  • HELM_REPO_URL: Git URL of Helm chart repository
  • TARGET_REVISION: Git revision to deploy (HEAD, branch, or tag)

Generic Application template

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: ${ENTITY_NAMESPACE}-${APP_SLUG}
spec:
  destination:
    namespace: ${ENTITY_NAMESPACE}
    server: https://kubernetes.default.svc
  source:
    path: .
    repoURL: ${HELM_REPO_URL}
    targetRevision: ${TARGET_REVISION}
  sources: []
  project: ${ARGO_PROJECT}

Notes:

  • This uses spec.source (single source) and keeps sources: [] empty, matching your provided structure.
  • Namespace is explicitly set in spec.destination.namespace.

Provided example (france-titres)

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: france-titres-hello-world
spec:
  destination:
    namespace: france-titres
    server: https://kubernetes.default.svc
  source:
    path: .
    repoURL: https://tools.playground.france-identite.gouv.fr/gitlab/plg/partners/france-titres/helm-hello-world.git
    targetRevision: HEAD
  sources: []
  project: france-titres

How namespace is applied

Namespace is used in three places:

  1. metadata.name prefix (france-titres-...)
  2. spec.destination.namespace (france-titres)
  3. spec.project (france-titres)

This keeps ownership, target namespace, and Argo permissions aligned.

Alignment with current Helm chart

The referenced repo is the Helm chart repository (helm-hello-world-main in local workspace), whose templates include:

  • templates/deployment.yaml
  • templates/service.yaml
  • templates/virtualservice.yaml

Sources: - helm-hello-world-main/templates/deployment.yaml - helm-hello-world-main/templates/service.yaml - helm-hello-world-main/templates/virtualservice.yaml

Verification checklist

  • Application appears in Argo CD and status is Synced.
  • Destination namespace matches entity namespace.
  • Deployed resources exist in ${ENTITY_NAMESPACE} namespace.
  • VirtualService route is reachable for /${ENTITY_NAMESPACE}/${APP_SLUG}/ pattern.

Assumptions

  • Argo CD project france-titres exists and is authorized for this repo and namespace.
  • Repository credentials are configured in Argo CD for the Git URL.

Why: these controls are outside the two code repos and not represented in chart templates.