From bb4d902693359dd6fb8d9e3f257bdd1148103264 Mon Sep 17 00:00:00 2001 From: Arnob Kumar Saha Date: Tue, 7 Jul 2026 13:15:54 +0600 Subject: [PATCH 1/2] docs: document MongoDB mongodb+srv style DNS (horizon) endpoints Signed-off-by: Arnob Kumar Saha --- .../create-database/mongodb.md | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/platform/guides/database-management/create-database/mongodb.md b/docs/platform/guides/database-management/create-database/mongodb.md index 89478e0..bec032a 100644 --- a/docs/platform/guides/database-management/create-database/mongodb.md +++ b/docs/platform/guides/database-management/create-database/mongodb.md @@ -35,7 +35,7 @@ When **Replicated Cluster** is selected, two additional fields appear: |---|---| | **Replicaset Name** | The name for the replica set (e.g., `rs0`). Required. | | **Replicaset Number** | The number of replica members (e.g., `3`). Required. | -| **mongodb+srv style DNS** | Toggle on to enable `mongodb+srv` connection string support for this replica set. | +| **mongodb+srv style DNS** | Toggle on to advertise externally reachable per-pod endpoints so clients can connect with a `mongodb+srv` connection string. Available only for **Replicated Cluster** mode, and only when the database has TLS and gateway exposure enabled — see [mongodb+srv Style DNS](#mongodbsrv-style-dns-replicated-cluster-only). | #### Sharded Cluster @@ -79,6 +79,27 @@ When **Sharded Cluster** is selected, three subsections appear — **Shard Nodes | **CPU** | CPU request (e.g., `500m`). | | **Memory** | Memory request (e.g., `1Gi`). | +## mongodb+srv Style DNS (Replicated Cluster Only) + +> **What this is for.** A `mongodb+srv://` connection string lets a client discover every replica set member from a single DNS SRV record instead of listing each host. To make that work from outside the cluster, every member must advertise an externally reachable address (this is MongoDB's *horizon* mechanism). The **mongodb+srv style DNS** toggle on the **Replicated Cluster** form configures those per-pod addresses. + +This applies **only** when you intend to reach a **Replicated Cluster** MongoDB from outside Kubernetes with a `mongodb+srv` connection string. If you only connect from within the cluster, use **Standalone**/**Sharded Cluster** mode, or connect with a standard `mongodb://` string, leave it off. + +**Prerequisites** — the toggle only takes effect when both are enabled (see [Additional Options](../common-steps/#6-additional-options)): + +- **TLS** on the database (upstream TLS). MongoDB requires TLS for SRV-based horizon connections. +- **Expose via Gateway**, so the members are reachable from outside the cluster. + +Turn on **mongodb+srv style DNS** to reveal the endpoints panel: + +![mongodb+srv style DNS toggle with SRV DNS Endpoints inputs](../../images/db-create/mongodb/horizon.png) + +| Field | Description | +|---|---| +| **SRV DNS Endpoints** | One entry per replica set member, in pod order (member 0, member 1, …). Each entry is the externally reachable endpoint that pod should advertise. The number of entries must match the **Replicaset Number** set above. Use **+ Add new** to add an entry. | + +The endpoints you enter must resolve to the externally reachable address of the exposed database and must be covered by the TLS certificate's SANs. + ## Additional MongoDB Options | Field | Description | @@ -91,6 +112,6 @@ When **Sharded Cluster** is selected, three subsections appear — **Shard Nodes 1. Open the wizard and select **MongoDB** — see [Getting Started](../common-steps/#1-getting-started) and [Select a Database Type](../common-steps/#2-select-a-database-type). 1. Set the [namespace and name](../common-steps/#3-choose-namespace-and-name). -1. Pick the database version and the **Database Mode** described above, then set the machine profile and storage — see [Configure the Database](../common-steps/#4-configure-the-database). +1. Pick the database version and the **Database Mode** described above, then set the machine profile and storage — see [Configure the Database](../common-steps/#4-configure-the-database). For **Replicated Cluster** mode, configure [mongodb+srv style DNS](#mongodbsrv-style-dns-replicated-cluster-only) if you'll connect with a `mongodb+srv` string from outside the cluster. 1. Optionally configure [Advanced Configuration](../common-steps/#5-advanced-configuration) (labels, deletion policy, credentials, point-in-time recovery) and [Additional Options](../common-steps/#6-additional-options) (monitoring, backup, TLS, gateway). 1. Click [**Deploy**](../common-steps/#7-deploy). From 7b78d5b84dd85eec1b3a9651a806fc39c2d12a7c Mon Sep 17 00:00:00 2001 From: Arnob Kumar Saha Date: Tue, 7 Jul 2026 13:21:36 +0600 Subject: [PATCH 2/2] docs: add required DNS records for mongodb+srv style DNS Signed-off-by: Arnob Kumar Saha --- .../database-management/create-database/mongodb.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/platform/guides/database-management/create-database/mongodb.md b/docs/platform/guides/database-management/create-database/mongodb.md index bec032a..8aa633b 100644 --- a/docs/platform/guides/database-management/create-database/mongodb.md +++ b/docs/platform/guides/database-management/create-database/mongodb.md @@ -100,6 +100,18 @@ Turn on **mongodb+srv style DNS** to reveal the endpoints panel: The endpoints you enter must resolve to the externally reachable address of the exposed database and must be covered by the TLS certificate's SANs. +### DNS records you must create + +The `mongodb+srv://` scheme is pure DNS discovery — the platform advertises the endpoints, but you must create the matching records in your DNS zone (for a replica set `rs0` on domain `example.com`): + +| Record | Example | Why it's needed | +|---|---|---| +| **A** / **CNAME** — one per member | `mongo-0.example.com → ` (repeat for each member) | Each **SRV DNS Endpoint** you entered must resolve to the member's externally reachable address. Use **A** for a fixed IP, **CNAME** to alias a managed hostname. | +| **SRV** — one per member, same name | `_mongodb._tcp.example.com IN SRV 0 0 mongo-0.example.com.` | This is what the driver queries first: connecting to `mongodb+srv://example.com` returns all members (host + port) so the client discovers the full replica set from one name. | +| **TXT** — one, same name | `example.com IN TXT "replicaSet=rs0&authSource=admin"` | The SRV scheme requires a TXT record alongside the SRV to carry options that don't fit in SRV fields; the driver auto-appends `replicaSet`/`authSource` so the app never hardcodes them. | + +Verify before relying on it: `dig SRV _mongodb._tcp.example.com` and `dig TXT example.com`. + ## Additional MongoDB Options | Field | Description |