apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: n8n
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: 'https://community-charts.github.io/helm-charts'
    targetRevision: 1.3.5
    helm:
      parameters:
        - name: postgresql.enabled
          value: "true"
        - name: redis.enabled
          value: "true" 
        - name: redis.master.persistence.enabled
          value: "true"   
        - name: ingress.enabled
          value: "true"
        - name: ingress.className
          value: "traefik"
        - name: ingress.hosts[0].host
          value: "n8n.innovation-hub-niedersachsen.de"
        - name: ingress.hosts[0].paths[0].path
          value: "/"
        - name: ingress.hosts[0].paths[0].pathType
          value: "Prefix"
        - name: ingress.annotations.kubernetes\.io\/ingress\.class
          value: traefik   
        - name: ingress.tls[0].secretName
          value: "n8n-tls"
        - name: ingress.tls[0].hosts[0]
          value: "n8n.innovation-hub-niedersachsen.de"
        - name: ingress.annotations.traefik\.ingress\.kubernetes\.io\/router\.tls
          value: "true"
          forceString: true
        - name: ingress.annotations.cert-manager\.io\/cluster-issuer
          value: lets-encrypt-staging
    chart: n8n
  destination:
    server: 'https://kubernetes.default.svc'
    namespace: n8n
  syncPolicy:
    managedNamespaceMetadata:
      labels: 
        pod-security.kubernetes.io/enforce: "privileged"
    automated:
      selfHeal: true
      prune: true
    syncOptions:
      - CreateNamespace=true
