issuer-rancher.yaml 1.0 KB

12345678910111213141516171819202122
  1. {{- if eq .Values.tls "ingress" -}}
  2. {{- if eq .Values.ingress.tls.source "rancher" -}}
  3. {{- $certmanagerVer := split "." .Values.certmanager.version -}}
  4. {{- if or (.Capabilities.APIVersions.Has "cert-manager.io/v1beta1") (and (gt (len $certmanagerVer._0) 0) (eq (int $certmanagerVer._0) 0) (ge (int $certmanagerVer._1) 16)) }}
  5. apiVersion: cert-manager.io/v1beta1
  6. {{- else if or (.Capabilities.APIVersions.Has "cert-manager.io/v1alpha2") (and (gt (len $certmanagerVer._0) 0) (eq (int $certmanagerVer._0) 0) (ge (int $certmanagerVer._1) 11)) }}
  7. apiVersion: cert-manager.io/v1alpha2
  8. {{- else if or (.Capabilities.APIVersions.Has "certmanager.k8s.io/v1alpha1") (and (gt (len $certmanagerVer._0) 0) (eq (int $certmanagerVer._0) 0) (lt (int $certmanagerVer._1) 11)) }}
  9. apiVersion: certmanager.k8s.io/v1alpha1
  10. {{- else }}
  11. apiVersion: cert-manager.io/v1
  12. {{- end }}
  13. kind: Issuer
  14. metadata:
  15. name: {{ template "rancher.fullname" . }}
  16. labels:
  17. {{ include "rancher.labels" . | indent 4 }}
  18. spec:
  19. ca:
  20. secretName: tls-rancher
  21. {{- end -}}
  22. {{- end -}}