Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit e6f042a

Browse files
authored
Merge pull request #58 from ddecrulle/patch-2
correct bold in mongoUri display
2 parents 333efc3 + eb6e30b commit e6f042a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

charts/mongodb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type: application
2424
# This is the chart version. This version number should be incremented each time you make changes
2525
# to the chart and its templates, including the app version.
2626
# Versions are expected to follow Semantic Versioning (https://semver.org/)
27-
version: 1.3.0
27+
version: 1.3.1
2828

2929
# This is the version number of the application being deployed. This version number should be
3030
# incremented each time you make changes to the application. Versions are not expected to

charts/mongodb/templates/NOTES.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{- $fullname := include "library-chart.fullname" . }}
44
{{- $user := .Values.mongodb.auth.username }}
55
{{- $password := .Values.mongodb.auth.password }}
6+
{{- $rootPassword := .Values.mongodb.auth.rootPassword }}
67
{{- $db := .Values.mongodb.auth.database }}
78
{{- $pvcList := list }}
89
{{- $mongoList := list }}
@@ -11,16 +12,21 @@
1112
{{- $mongoList = append $mongoList (printf "%s-%d.%s-headless:%d" $fullname $i $fullname $portNumber) }}
1213
{{- end }}
1314
- the connection string is :
14-
```
15-
**mongodb://{{ $user }}:{{ $password }}@{{ (include "mongoList" .)}}/{{ $db }}**
16-
```
15+
16+
**`mongodb://{{ $user }}:{{ $password }}@{{ (include "mongoList" .)}}/{{ $db }}?authSource{{ $db }}`**
1717
- example for python :
1818

1919
```
2020
from pymongo import MongoClient
21-
client = MongoClient('mongodb://{{ $user }}:{{ $password }}@{{ (include "mongoList" .) }}/{{ $db }}')
21+
client = MongoClient('mongodb://{{ $user }}:{{ $password }}@{{ (include "mongoList" .) }}/{{ $db }}?authSource{{ $db }}')
2222
db=client.{{ $db }}
2323
```
24+
- example for mongosh :
25+
26+
* as user in {{ $db }}
27+
`mongo -u {{ $user }} -p {{ $password }} --authenticationDatabase {{ $db }}`
28+
* as root
29+
`mongo -u root -p {{ $rootPassword }}`
2430

2531
*NOTES about deletion :*
2632

0 commit comments

Comments
 (0)