26 lines
815 B
YAML
26 lines
815 B
YAML
|
{{- define "common.resources.cert.secret" -}}
|
||
|
|
||
|
|
||
|
{{- $secretName := include "common.names.fullname" . -}}
|
||
|
|
||
|
{{- if .ObjectValues.certHolder -}}
|
||
|
{{- if hasKey .ObjectValues.certHolder "nameSuffix" -}}
|
||
|
{{- $secretName = printf "%v-%v" $secretName .ObjectValues.certHolder.nameSuffix -}}
|
||
|
{{ end -}}
|
||
|
{{ else }}
|
||
|
{{- $_ := set $ "ObjectValues" (dict "certHolder" .Values) -}}
|
||
|
{{ end -}}
|
||
|
|
||
|
{{- if eq (include "common.resources.cert.available" $ ) "true" -}}
|
||
|
apiVersion: v1
|
||
|
kind: Secret
|
||
|
metadata:
|
||
|
name: {{ $secretName }}
|
||
|
labels: {{ include "common.labels" . | nindent 4 }}
|
||
|
type: kubernetes.io/tls
|
||
|
data:
|
||
|
tls.crt: {{ (include "common.resources.cert.publicKey" $ ) | toString | b64enc | quote }}
|
||
|
tls.key: {{ (include "common.resources.cert.privateKey" $ ) | toString | b64enc | quote }}
|
||
|
{{- end -}}
|
||
|
{{- end -}}
|