You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/deploy-configure.md
+50-4Lines changed: 50 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,58 @@ To deploy your first replica set:
24
24
```
25
25
kubectl get mongodbcommunity --namespace <my-namespace>
26
26
```
27
-
4. Connect clients to the MongoDB replica set:
27
+
28
+
4. The Community Kubernetes Operator creates secrets that contains users' connection strings and credentials.
29
+
30
+
The secrets follow this naming convention: `<metadata.name>-<auth-db>-<username>`, where:
31
+
32
+
| Variable | Description | Value in Sample |
33
+
|----|----|----|
34
+
|`<metadata.name>`| Name of the MongoDB database resource. |`example-mongodb`|
35
+
|`<auth-db>`|[Authentication database](https://docs.mongodb.com/manual/core/security-users/#std-label-user-authentication-database) where you defined the database user. |`admin`|
36
+
|`<username>`| Username of the database user. |`my-user`|
37
+
38
+
Update the variables in the following command, then run it to retrieve a user's connection strings to the replica set from the secret:
39
+
40
+
**NOTE**: The following command requires [jq](https://stedolan.github.io/jq/) version 1.6 or higher.</br></br>
41
+
42
+
```sh
43
+
kubectl get secret <metadata.name>-<auth-db>-<username> -n mongodb -o json |\
44
+
jq -r '.data | with_entries(.value |= @base64d)'
45
+
```
46
+
47
+
The command returns the replica set's standard and DNS seed list [connection strings](https://docs.mongodb.com/manual/reference/connection-string/#connection-string-formats) in addition to the user's name and password:
**NOTE**: The Community Kubernetes Operator sets the [`ssl` connection option](https://docs.mongodb.com/manual/reference/connection-string/#connection-options) to `true` if you [Secure MongoDB Resource Connections using TLS](secure.md#secure-mongodb-resource-connections-using-tls).</br></br>
59
+
60
+
You can use the connection strings in this secret in your application:
61
+
62
+
```yaml
63
+
containers:
64
+
- name: test-app
65
+
env:
66
+
- name: "CONNECTION_STRING"
67
+
valueFrom:
68
+
secretKeyRef:
69
+
name: <metadata.name>-<auth-db>-<username>
70
+
key: connectionString.standardSrv
71
+
72
+
5. Use one of the connection strings returned in the previous step to connect to the replica set:
0 commit comments