apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kube-prometheus-stack
  namespace: argocd
  labels:
    env: dev
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  syncPolicy:
    automated:
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
      - ServerSideApply=true # do not copy metdata, since (because of its large size) it can lead to sync failure
    retry:
      limit: -1
      backoff:
        duration: 15s
        factor: 1
        maxDuration: 15s
  destination:
    name: in-cluster
    namespace: monitoring
  sources:
    - repoURL: https://github.com/prometheus-community/helm-charts
      path: charts/kube-prometheus-stack
      targetRevision: HEAD
      helm:
        valueFiles:
          - $values/rire/factory.c-one-infra.de/stacks/monitoring/kube-prometheus/values.yaml
    - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/stacks-instances
      targetRevision: HEAD
      ref: values
    - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/stacks-instances
      targetRevision: HEAD
      path: "rire/factory.c-one-infra.de/stacks/monitoring/kube-prometheus/manifests"
