webhook-certificate.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{- if and .Values.webhook.create .Values.webhook.certManager.enabled .Values.webhook.certManager.cert.create }}
  2. ---
  3. apiVersion: cert-manager.io/v1
  4. kind: Certificate
  5. metadata:
  6. name: {{ include "external-secrets.fullname" . }}-webhook
  7. namespace: {{ template "external-secrets.namespace" . }}
  8. labels:
  9. {{- include "external-secrets-webhook.labels" . | nindent 4 }}
  10. external-secrets.io/component: webhook
  11. {{- with .Values.webhook.certManager.cert.annotations }}
  12. annotations:
  13. {{- toYaml . | nindent 4 }}
  14. {{- end }}
  15. spec:
  16. commonName: {{ include "external-secrets.fullname" . }}-webhook
  17. dnsNames:
  18. - {{ include "external-secrets.fullname" . }}-webhook
  19. - {{ include "external-secrets.fullname" . }}-webhook.{{ template "external-secrets.namespace" . }}
  20. - {{ include "external-secrets.fullname" . }}-webhook.{{ template "external-secrets.namespace" . }}.svc
  21. issuerRef:
  22. {{- toYaml .Values.webhook.certManager.cert.issuerRef | nindent 4 }}
  23. {{- with .Values.webhook.certManager.cert.duration }}
  24. duration: {{ . | quote }}
  25. {{- end }}
  26. {{- with .Values.webhook.certManager.cert.privateKey }}
  27. privateKey:
  28. {{ toYaml . | indent 4 }}
  29. {{- end }}
  30. {{- if .Values.webhook.certManager.cert.signatureAlgorithm }}
  31. signatureAlgorithm: {{ .Values.webhook.certManager.cert.signatureAlgorithm }}
  32. {{- end }}
  33. {{- with .Values.webhook.certManager.cert.renewBefore }}
  34. renewBefore: {{ . | quote }}
  35. {{- end }}
  36. {{- if gt (.Values.webhook.certManager.cert.revisionHistoryLimit | int) 0 }}
  37. revisionHistoryLimit: {{ .Values.webhook.certManager.cert.revisionHistoryLimit }}
  38. {{- end }}
  39. secretName: {{ include "external-secrets.fullname" . }}-webhook
  40. {{- end }}