apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: k8up
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  sources:
    - path: system/k8up
      repoURL: https://git.tbrnt.ch/tobru/gitops-zurrli.git
      targetRevision: HEAD
    - chart: k8up
      repoURL: https://k8up-io.github.io/k8up
      targetRevision: 4.2.2
      helm:
        values: |
          k8up:
            envVars:
              - name: BACKUP_GLOBALACCESSKEYID
                valueFrom:
                  secretKeyRef:
                    name: global-s3-credentials
                    key: access-key-id
              - name: BACKUP_GLOBALSECRETACCESSKEY
                valueFrom:
                  secretKeyRef:
                    name: global-s3-credentials
                    key: access-key-secret
              - name: BACKUP_GLOBALREPOPASSWORD
                valueFrom:
                  secretKeyRef:
                    name: global-backup-secret
                    key: secret
              - name: BACKUP_GLOBALS3ENDPOINT
                value: http://100.64.0.8:9050
              - name: BACKUP_GLOBALS3BUCKET
                value: zurrli-k8up
              - name: BACKUP_PROMURL
                value: prometheus-pushgateway.monitoring.svc:9091
          metrics:
            serviceMonitor:
              enabled: true
  destination:
    namespace: k8up
    server: https://kubernetes.default.svc
  project: system
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
