apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: eck-resources
  namespace: argocd
spec:
  generators:
    - list:
        elements:
          - env: prod
            valuesFile: values-prod.yaml
            nameSuffix: eck-prod
            host: kibana.dvirlabs.com
          - env: int
            valuesFile: values-int.yaml
            nameSuffix: eck-int
            host: kibana-int.dvirlabs.com
  template:
    metadata:
      name: '{{nameSuffix}}'
    spec:
      project: observability
      source:
        repoURL: https://git.dvirlabs.com/dvirlabs/observability-stack.git
        targetRevision: master
        path: charts/eck-resources
        helm:
          valueFiles:
            - my-values/{{valuesFile}}
      destination:
        server: https://kubernetes.default.svc
        namespace: monitoring
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
          - CreateNamespace=true
