apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: grafana
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: 'https://grafana.github.io/helm-charts'
    path: 'grafana'
    targetRevision: 9.*.*
    chart: grafana
    helm:
      parameters:
        - name: ingress.enabled
          value: 'true'
        - name: ingress.hosts[0]
          value: 'grafana.innovation-hub-niedersachsen.de'
        - name: ingress.tls[0].hosts[0]
          value: 'grafana.innovation-hub-niedersachsen.de'
        - name: ingress.tls[0].secretName
          value: 'grafana.innovation-hub-niedersachsen.de-tls'
        - name: ingress.annotations.kubernetes\.io\/ingress\.class
          value: traefik
        - name: ingress.annotations.traefik\.ingress\.kubernetes\.io\/router\.tls
          value: 'true'
          forceString: true
        - name: ingress.annotations.cert-manager\.io\/cluster-issuer
          value: 'lets-encrypt'
        - name: ingress.annotations.ingress\.secrets
          value: 'grafana.innovation-hub-niedersachsen.de-tls'
        - name: ingress.annotations.traefik\.ingress\.kubernetes\.io\/router\.entrypoints
          value: websecure
        - name: persistence.enabled
          value: 'true'  
        - name: adminUser
          value: 'admin'
        - name: adminPassword
          value: 'InnoHubGRAFANA_2024!'
  destination:
    server: 'https://kubernetes.default.svc'
    namespace: grafana
  syncPolicy:
    managedNamespaceMetadata:
      labels: 
        pod-security.kubernetes.io/enforce: "privileged"
    automated:
      selfHeal: true
      prune: true
    syncOptions:
      - CreateNamespace=true
      - RespectIgnoreDifferences=true
