apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: portfolio-production
  namespace: argocd
  finalizers: [resources-finalizer.argocd.argoproj.io]
spec:
  project: portfolio-platform
  source:
    repoURL: https://github.com/OWNER/GITOPS-REPOSITORY.git
    targetRevision: main
    path: environments/production
    helm: { valueFiles: [values.yaml] }
  destination: { server: https://kubernetes.default.svc, namespace: portfolio-production }
  syncPolicy:
    automated: { prune: true, selfHeal: true, allowEmpty: false }
    syncOptions: [CreateNamespace=true, PruneLast=true, ApplyOutOfSyncOnly=true]
    retry: { limit: 5, backoff: { duration: 10s, factor: 2, maxDuration: 3m } }
