apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: cert-manager
  namespace: argocd
spec:
  destination:
    namespace: cert-manager
    server: 'https://kubernetes.default.svc'
  sources:
  - repoURL: {{ .Values.cluster_config.manifests }}
    path: {{ .Values.cluster_config.policies }}/cert-manager
    targetRevision: HEAD
  - repoURL: 'https://charts.jetstack.io'
    targetRevision: {{ .Values.cert_manager.version }}
    chart: cert-manager
    helm:
      values: |
        installCRDs: true
        enableCertificateOwnerRef: true
        startupapicheck:
          podAnnotations:
            linkerd.io/inject: disabled
  project: sys
  syncPolicy:
    managedNamespaceMetadata:
      labels:
        component: sys
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true
    {{- if .Values.cert_manager.autosync }}
    automated:
      prune: true
      # selfHeal: false
    {{- end }}
