-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathsecret.yaml
More file actions
28 lines (28 loc) · 1.59 KB
/
secret.yaml
File metadata and controls
28 lines (28 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
apiVersion: v1
kind: Secret
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
{{- if .Values.smtp.enabled }}
mail-url: {{ printf "smtp://%s:%s@%s:%.0f" .Values.smtp.username .Values.smtp.password .Values.smtp.host .Values.smtp.port | b64enc | quote }}
{{- end }}
{{- if .Values.externalMongodbUrl }}
mongo-uri: {{ .Values.externalMongodbUrl | b64enc | quote }}
mongo-oplog-uri: {{ required "Please specify the external MongoDB OpLog URL" .Values.externalMongodbOplogUrl | b64enc | quote }}
{{- else }}
{{- $fullname := include "rocketchat.mongodb.fullname" . -}}
{{- $username := required "Please specify a MongoDB username" .Values.mongodb.auth.username }}
{{- $password := required "Please specify a MongoDB password" .Values.mongodb.auth.password }}
{{- $rootPassword := required "Please specify a MongoDB password" .Values.mongodb.auth.rootPassword }}
{{- $rsName := .Values.mongodb.replicaSetName }}
{{- $port := .Values.mongodb.service.port }}
{{- $dbname := required "Please specify a MongoDB database" .Values.mongodb.auth.database }}
mongo-uri: {{ printf "mongodb://%s:%s@%s:%.0f/%s?replicaSet=%s" $username $password $fullname $port $dbname $rsName | b64enc | quote }}
mongo-oplog-uri: {{ printf "mongodb://root:%s@%s:%.0f/local?replicaSet=%s&authSource=admin" $rootPassword $fullname $port $rsName | b64enc | quote }}
{{- end }}