catalog/dev/livebook/3.1.1/templates/_secrets.tpl

16 lines
652 B
Smarty
Raw Normal View History

{{/* Define the secrets */}}
{{- define "livebook.secrets" -}}
{{- $secretName := (printf "%s-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
{{/* Base64 encoding is intended, application expects a b64 formatted value */}}
{{- $secretKeyBase := randAlphaNum 48 | b64enc -}}
{{- $cookie := randAlphaNum 20 -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
{{- $secretKeyBase = index .data "LIVEBOOK_SECRET_KEY_BASE" | b64dec -}}
{{- $cookie = index .data "LIVEBOOK_COOKIE" | b64dec -}}
{{- end }}
enabled: true
data:
LIVEBOOK_SECRET_KEY_BASE: {{ $secretKeyBase }}
LIVEBOOK_COOKIE: {{ $cookie }}
{{- end -}}