apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: mattermost
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: 'https://helm.mattermost.com'
    targetRevision: 6.*.*
    helm:
      parameters:
        - name: 'ingress.enabled'
          value: 'true'
        - name: 'endpoint'
          value: 'mattermost.innovation-hub-niedersachsen.de'
        - name: ingress.hosts[0]
          value: 'mattermost.innovation-hub-niedersachsen.de'
        - name: 'ingress.tls[0].hosts[0]'
          value: 'mattermost.innovation-hub-niedersachsen.de'
        - name: 'ingress.tls[0].secretName'
          value: mattermost-tls
        - name: ingress.annotations.kubernetes\.io\/ingress\.class
          value: traefik
        - name: ingress.annotations.traefik\.ingress\.kubernetes\.io\/router\.tls
          value: 'true'
          forceString: true
        - name: ingress.annotations.traefik\.ingress\.kubernetes\.io\/router\.middlewares
          value: 'default-http-redirect@kubernetescrd'
        - name: ingress.annotations.cert-manager\.io\/cluster-issuer
          value: lets-encrypt
        - name: mysql.mysqlUser
          value: 'mmdbuser'
        - name: mysql.mysqlPassword
          value: 'mmdbpwd'
    chart: mattermost-team-edition
  destination:
    server: 'https://kubernetes.default.svc'
    namespace: mattermost
  syncPolicy:
    managedNamespaceMetadata:
      labels: 
        pod-security.kubernetes.io/enforce: "privileged"
    automated:
      selfHeal: true
      prune: true
    syncOptions:
      - CreateNamespace=true