helm-charts/nextcloud/templates/db-secret.yaml
2021-01-17 04:09:41 +03:00

22 lines
867 B
YAML

{{- if or .Values.mariadb.enabled .Values.externalDatabase.enabled }}
{{- if not .Values.externalDatabase.existingSecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-%s" .Release.Name "db" }}
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
{{- if .Values.mariadb.enabled }}
db-password: {{ default "" .Values.mariadb.db.password | b64enc | quote }}
db-username: {{ default "" .Values.mariadb.db.user | b64enc | quote }}
{{- else }}
db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }}
db-username: {{ default "" .Values.externalDatabase.user | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}