apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: grafana
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: apps
  sources:
    - chart: grafana
      repoURL: https://grafana.github.io/helm-charts
      targetRevision: 6.56.6
      helm:
        values: |
          env:
            GF_AUTH_ANONYMOUS_ENABLED: true
            GF_SERVER_DOMAIN: graphs.tbrnt.ch
            GF_SERVER_ROOT_URL: https://graphs.tbrnt.ch

          ingress:
            enabled: true
            hosts:
              - graphs.tbrnt.ch
            tls:
              - hosts:
                - graphs.tbrnt.ch
                secretName: graphs-tbrnt-ch-cert
            annotations:
              cert-manager.io/cluster-issuer: letsencrypt-prod
              traefik.ingress.kubernetes.io/router.middlewares: kube-system-redirect-https@kubernetescrd

          persistence:
            enabled: true
            size: 1Gi
            storageClassName: local-path

          rbac:
            namespaced: true

          admin:
            existingSecret: admin-creds
    - path: apps/grafana
      repoURL: https://git.tbrnt.ch/tobru/gitops-zurrli.git
      targetRevision: HEAD
  destination:
    namespace: grafana
    server: https://kubernetes.default.svc
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
