peridot/infrastructure/dev-helm/temporal/templates/server-secret.yaml

35 lines
1.5 KiB
YAML

{{- if $.Values.server.enabled }}
{{- range $store := (list "default" "visibility") }}
{{- $storeConfig := index $.Values.server.config.persistence $store }}
{{- $driverConfig := index $storeConfig (include "temporal.persistence.driver" (list $ $store)) }}
{{- $secretName := include "temporal.componentname" (list $ (printf "%s-store" $store)) }}
{{- if and (not $driverConfig.existingSecret) (eq (include "temporal.persistence.secretName" (list $ $store)) $secretName) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
labels:
app.kubernetes.io/name: {{ include "temporal.name" $ }}
helm.sh/chart: {{ include "temporal.chart" $ }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
{{- with $.Values.server.secretLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $.Values.server.secretAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
password: {{ $storeConfig.cassandra.password | b64enc | quote }}
{{- else if eq (include "temporal.persistence.driver" (list $ $store)) "sql" }}
password: {{ include "temporal.persistence.sql.password" (list $ $store) | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}