2022-10-10 12:09:27 +00:00
|
|
|
{{/* Define the secrets */}}
|
|
|
|
{{- define "couponstore.secrets" -}}
|
|
|
|
|
2023-12-15 21:41:48 +00:00
|
|
|
{{- $secretName := printf "%s-couponstore-secret" (include "tc.v1.common.names.fullname" .) }}
|
2022-10-10 12:09:27 +00:00
|
|
|
|
|
|
|
---
|
2023-12-15 21:41:48 +00:00
|
|
|
{{- $pg := .Values.cnpg.main }}
|
2022-10-10 12:09:27 +00:00
|
|
|
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
type: Opaque
|
|
|
|
metadata:
|
|
|
|
name: {{ $secretName }}
|
|
|
|
data:
|
|
|
|
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) }}
|
|
|
|
SECRET_KEY_BASE: {{ index .data "SECRET_KEY_BASE" }}
|
|
|
|
{{- else }}
|
2023-12-15 21:41:48 +00:00
|
|
|
SECRET_KEY_BASE: {{ randAlphaNum 32 }}
|
2022-10-10 12:09:27 +00:00
|
|
|
{{- end }}
|
2023-12-15 21:41:48 +00:00
|
|
|
DATABASE_URL: {{ printf "postgres://%v:%v@%v-postgresql:5432/%v" $pg.user ($pg.postgresqlPassword | trimAll "\"") .Release.Name $pg.database }}
|
2022-10-10 12:09:27 +00:00
|
|
|
{{- end -}}
|