{{- if and (not .Values.keycloak.persistence.deployPostgres) (not .Values.keycloak.persistence.existingSecret) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "keycloak.fullname" . }}-db
  labels:
    app: {{ template "keycloak.name" . }}
    chart: {{ template "keycloak.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
type: Opaque
data:
  {{ template "keycloak.dbPasswordKey" . }}: {{ .Values.keycloak.persistence.dbPassword | b64enc | quote }}
{{- end -}}
