sprig
sprig copied to clipboard
Share CA cert to multiple files
I am trying to setup CA and server cert for my auth webhook in Helm. I have created following template in _helper.tpl.
{{/*
Generate certificates for auth
*/}}
{{- define "auth.gen-certs" -}}
{{- $ca := genCA "guard-ca" 365 -}}
{{- $ip := default .Values.systemDefaultValues.auth.clusterIP -}}
{{- $cert := genSignedCert "auth-server" (list $ip "127.0.0.1") nil 365 $ca -}}
ca.crt: {{ $ca.Cert | b64enc }}
server.crt: {{ $cert.Cert | b64enc }}
server.key: {{ $cert.Key | b64enc }}
{{- end -}}
In addition to set ca.crt, server.crt and server.key as secret, I need to refer the same individually in [Webhook configuration] https://kubernetes.io/docs/reference/access-authn-authz/webhook/) file. Is there a way to access ca.crt, server,crt and key independently from above?
The other approach I tried was to define all of them as separate. However it's giving issue similar to #147 . Thanks in advance!