---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: traefik
  namespace: argocd
spec:
  project: default
  sources:
    - repoURL: https://traefik.github.io/charts
      chart: traefik
      targetRevision: 26.1.0
      helm:
        releaseName: traefik
        valueFiles:
        - $values/traefik/values.yaml
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      ref: values
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      path: traefik
  destination:
    server: https://kubernetes.default.svc
    namespace: traefik
  syncPolicy:
    syncOptions:
    - CreateNamespace=true

    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argocd-ingress
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: argo
  destination:
    server: https://kubernetes.default.svc
    namespace: argocd
  syncPolicy:
    syncOptions:
    - CreateNamespace=true

    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: longhorn
  namespace: argocd
spec:
  project: default
  sources:
    - repoURL: https://charts.longhorn.io
      chart: longhorn
      targetRevision: 1.6.0 # see Infos below, the CSI snapshotter needs to be updated too <-- version association can be found here: https://longhorn.io/docs/latest/snapshots-and-backups/csi-snapshot-support/enable-csi-snapshot-support/
      helm:
        releaseName: longhorn
        valueFiles:
        - $values/longhorn/values.yaml
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      ref: values
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      path: longhorn
    - repoURL: https://github.com/kubernetes-csi/external-snapshotter.git
      targetRevision: v6.3.2 # <-- needs to be updated when longhorn version is changed. Find the correct version here: https://longhorn.io/docs/latest/snapshots-and-backups/csi-snapshot-support/csi-volume-snapshot-associated-with-longhorn-snapshot/
      path: client/config/crd
    - repoURL: https://github.com/kubernetes-csi/external-snapshotter.git
      targetRevision: v6.3.2 # <-- needs to be updated when longhorn version is changed. Find the correct version here: https://longhorn.io/docs/latest/snapshots-and-backups/csi-snapshot-support/csi-volume-snapshot-associated-with-longhorn-snapshot/
      path: deploy/kubernetes/snapshot-controller
  destination:
    server: https://kubernetes.default.svc
    namespace: longhorn-system
  syncPolicy:
    syncOptions:
    - CreateNamespace=true

    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prometheus
  namespace: argocd
spec:
  project: default
  sources:
    - chart: kube-prometheus-stack
      repoURL: https://prometheus-community.github.io/helm-charts
      targetRevision: 56.9.0
      helm:
        releaseName: prometheus
        valueFiles:
        - $values/prometheus/values.yaml
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      ref: values
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      path: prometheus
  destination:
    server: https://kubernetes.default.svc
    namespace: prometheus
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    - ServerSideApply=true

    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: node-labeler
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: node-labeler
  destination:
    server: https://kubernetes.default.svc
    namespace: node-labeler
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: quota
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: quota
  destination:
    server: https://kubernetes.default.svc
    namespace: quota
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: dashboard
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: dashboard/prod
  destination:
    server: https://kubernetes.default.svc
    namespace: dashboard
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: dashboard-staging
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: dashboard/staging
  destination:
    server: https://kubernetes.default.svc
    namespace: dashboard-staging
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: loki
  namespace: argocd
spec:
  project: default
  sources:
    - chart: loki
      repoURL: https://grafana.github.io/helm-charts
      targetRevision: 5.43.3
      helm:
        releaseName: loki
        valueFiles:
        - $values/loki/values.yaml
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      ref: values
    - repoURL: https://git.ar21.de/yolokube/core-deployments.git
      targetRevision: HEAD
      path: loki
  destination:
    server: https://kubernetes.default.svc
    namespace: logs
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: promtail
  namespace: argocd
spec:
  project: default
  sources:
    - chart: promtail
      repoURL: https://grafana.github.io/helm-charts
      targetRevision: 6.15.5
      helm:
        releaseName: promtail
  destination:
    server: https://kubernetes.default.svc
    namespace: logs
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: metrics-server
  namespace: argocd
spec:
  project: default
  sources:
    - chart: metrics-server
      repoURL: https://kubernetes-sigs.github.io/metrics-server/
      targetRevision: 3.12.0
      helm:
        releaseName: metrics-server
        values: |
          metrics:
            enabled: true
          serviceMonitor:
            enabled: true
          replicas: 2
          args:
            - --kubelet-insecure-tls
  destination:
    server: https://kubernetes.default.svc
    namespace: kube-system
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: false
      prune: true
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: core-deployments-self
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/core-deployments.git
    targetRevision: HEAD
    path: "app-files"
  destination:
    server: https://kubernetes.default.svc
    namespace: argocd
  syncPolicy:
    automated:
      selfHeal: false
      prune: false
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: grafana-backuper
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.ar21.de/yolokube/grafana-backuper-deployment.git
    targetRevision: HEAD
    path: "overlay"
  destination:
    server: https://kubernetes.default.svc
    namespace: grafana-backuper
  syncPolicy:
    automated:
      selfHeal: true
      prune: true