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

12 lines
430 B
YAML
Raw Normal View History

{{- 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 32 | b64enc) }}
password: {{ $secretKey | quote }}
{{- end }}