k8s-charts/charts/tandoor-recipes/templates/secret.yaml

12 lines
430 B
YAML
Raw Normal View History

2024-01-29 14:37:59 +00:00
{{- if empty .Values.secretKey }}
apiVersion: v1
kind: Secret
metadata:
name: "recipes-secret-key"
type: Opaque
data:
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "recipes-secret-key") | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
{{- $secretKey := (get $secretData "recipes-secret-key") | default (randAlphaNum 64 | b64enc) }}
password: {{ $secretKey | quote }}
{{- end }}