The contract
Git holds the desired state; a controller reconciles the cluster towards it. CI builds and pushes artefacts and opens a change to the manifests — CI never talks to the cluster.
Repository layout
platform/
apps/
payments/
base/
deployment.yaml
service.yaml
kustomization.yaml
overlays/
staging/kustomization.yaml
prod/kustomization.yaml
argocd/
projects/payments.yaml
applications/payments-prod.yamlAn Application with sensible sync policy
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: payments-prod
namespace: argocd
spec:
project: payments
source:
repoURL: [email protected]:acme/platform.git
targetRevision: main
path: apps/payments/overlays/prod
destination:
server: https://kubernetes.default.svc
namespace: payments
syncPolicy:
automated: { prune: true, selfHeal: true }
syncOptions: [CreateNamespace=true, PrunePropagationPolicy=foreground]
retry:
limit: 5
backoff: { duration: 10s, factor: 2, maxDuration: 3m }Secrets
Plain Secret manifests do not belong in Git. Use Sealed Secrets or the External Secrets Operator so the repository holds a reference or a ciphertext, never a credential.
Promotion
CI builds the image and pushes it by digest.
An automated commit updates the staging overlay.
Argo CD syncs staging; smoke tests run against it.
A human opens a pull request promoting the same digest to prod.
What to alert on
Application health degraded for more than five minutes.
OutOfSync with automated sync enabled — the controller is failing.
Repeated sync retries, which usually means an admission webhook is rejecting the manifest.