Files
charts/bitnami/mongodb/templates/secrets.yaml
benjamin-wright 055679aac7 [bitnami/mongodb] adding local and global namespace overrides for mongodb (#2351)
* update to allow parent charts to override the namespace in the mongodb chart

* correct readme mistake

* add global namespace overrides

* reuse mongodb.namespace template

* add global namespace override to production values.yaml

* first of the review updates

* minor version bump

* remove redundant local namespaceOverride, can just use the global with fewer edge-cases

* typo in .values

* [bitnami/mongodb] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Ben Wright <benjamin.wright@nielsen.com>
Co-authored-by: Bitnami Containers <containers@bitnami.com>
Co-authored-by: Miguel Ángel Cabrera Miñagorri <macabrera@bitnami.com>
2020-04-22 09:49:49 +02:00

34 lines
1.1 KiB
YAML

{{ if and .Values.usePassword (not .Values.existingSecret) -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "mongodb.fullname" . }}
namespace: {{ template "mongodb.namespace" . }}
labels:
app: {{ template "mongodb.name" . }}
chart: {{ template "mongodb.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{- if .Values.mongodbRootPassword }}
mongodb-root-password: {{ .Values.mongodbRootPassword | b64enc | quote }}
{{- else }}
mongodb-root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- if and .Values.mongodbUsername .Values.mongodbDatabase }}
{{- if .Values.mongodbPassword }}
mongodb-password: {{ .Values.mongodbPassword | b64enc | quote }}
{{- else }}
mongodb-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- end }}
{{- if .Values.replicaSet.enabled }}
{{- if .Values.replicaSet.key }}
mongodb-replica-set-key: {{ .Values.replicaSet.key | b64enc | quote }}
{{- else }}
mongodb-replica-set-key: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}