Files
fission-src/charts/fission-all/templates/_certs.tpl
T
9a07d7d96b Add validation/mutating webhook server for Fission custom resources (#2608)
* add webhook server
* add metrics port
* Add self-signed cert generation in helm chart for webhooks (#2611)
* remove cert-manager installation
* update fission webhook charts
* remove extra cluster role
* add mutating webhook for pkg creation
* Service name and bundle fixes (#2614)
* caBundle templating
* Rename fission.svc to fission-webhook.svc
* update package build status

Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-11-13 17:31:31 +05:30

44 lines
2.0 KiB
Smarty

{{- define "fision.selfSignedCABundleCertPEM" -}}
{{- $caKeypair := .selfSignedCAKeypair | default (genCA "fission-ca" 1825) -}}
{{- $_ := set . "selfSignedCAKeypair" $caKeypair -}}
{{- $caKeypair.Cert -}}
{{- end -}}
{{- define "webhook.caBundleCertPEM" -}}
{{- if .Values.webhook.caBundlePEM -}}
{{- trim .Values.webhook.caBundlePEM -}}
{{- else -}}
{{- $caKeypair := .selfSignedCAKeypair | default (genCA "fission-ca" 1825) -}}
{{- $_ := set . "selfSignedCAKeypair" $caKeypair -}}
{{- $caKeypair.Cert -}}
{{- end -}}
{{- end -}}
{{- define "webhook.certPEM" -}}
{{- if .Values.webhook.crtPEM -}}
{{- trim .Values.webhook.crtPEM -}}
{{- else -}}
{{- $webhookName := printf "%s.%s.svc" (include "fission-webhook.svc" .) .Release.Namespace }}
{{- $fullWebhookName := printf "%s.%s.svc.cluster.local" (include "fission-webhook.svc" .) .Release.Namespace -}}
{{- $webhookCA := required "self-signed CA keypair is requried" .selfSignedCAKeypair -}}
{{- $webhookServerTLSKeypair := .webhookTLSKeypair | default (genSignedCert $webhookName nil (list $webhookName $fullWebhookName) 1825 $webhookCA) }}
{{- $_ := set . "webhookTLSKeypair" $webhookServerTLSKeypair -}}
{{- $webhookServerTLSKeypair.Cert -}}
{{- end -}}
{{- end -}}
{{- define "webhook.keyPEM" -}}
{{- if .Values.webhook.keyPEM -}}
{{ trim .Values.webhook.keyPEM }}
{{- else -}}
{{- $webhookName := printf "%s.%s.svc" (include "fission-webhook.svc" .) .Release.Namespace -}}
{{- $fullWebhookName := printf "%s.%s.svc.cluster.local" (include "fission-webhook.svc" .) .Release.Namespace -}}
{{- $webhookCA := required "self-signed CA keypair is requried" .selfSignedCAKeypair -}}
{{- $webhookServerTLSKeypair := .webhookTLSKeypair | default (genSignedCert $webhookName nil (list $webhookName $fullWebhookName) 1825 $webhookCA) -}}
{{- $_ := set . "webhookTLSKeypair" $webhookServerTLSKeypair -}}
{{- $webhookServerTLSKeypair.Key -}}
{{- end -}}
{{- end -}}