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
## Overview
- Added to external PG page section for mtls support
- Updated existing redis MTLS docs
## Type of change
Update Existing documentation
## Related issues/PRs
Closes INF-1268
## Checklist
<!-- Put an 'x' in all boxes that apply -->
- [X] I have read the [contributing guidelines](README.md)
- [X] I have tested my changes locally using `docs dev`
- [X] All code examples have been tested and work correctly
- [X] I have used **root relative** paths for internal links
- [ ] I have updated navigation in `src/docs.json` if needed
---------
Co-authored-by: Kathryn May <44557882+katmayb@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/langsmith/self-host-external-postgres.mdx
+110-4Lines changed: 110 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Connect to an external PostgreSQL database
3
3
sidebarTitle: Connect to an external PostgreSQL database
4
4
---
5
5
6
-
LangSmith uses a PostgreSQL database as the primary data store for transactional workloads and operational data (almost everything besides runs). By default, LangSmith Self-Hosted will use an internal PostgreSQL database. However, you can configure LangSmith to use an external PostgreSQL database (). By configuring an external PostgreSQL database, you can more easily manage backups, scaling, and other operational tasks for your database.
6
+
LangSmith uses a PostgreSQL database as the primary data store for transactional workloads and operational data (almost everything besides runs). By default, LangSmith Self-Hosted will use an internal PostgreSQL database. However, you can configure LangSmith to use an external PostgreSQL database. By configuring an external PostgreSQL database, you can more easily manage backups, scaling, and other operational tasks for your database.
7
7
8
8
## Requirements
9
9
@@ -17,13 +17,13 @@ LangSmith uses a PostgreSQL database as the primary data store for transactional
17
17
18
18
* A user with admin access to the PostgreSQL database. This user will be used to create the necessary tables, indexes, and schemas.
19
19
20
-
* This user will also need to have the ability to create extensions in the database. We use/will try to install the btree\_gin, btree\_gist, pgcrypto, citext, ltree, and pg\_trgm extensions.
20
+
* This user will also need to have the ability to create extensions in the database. We use/will try to install the `btree_gin`, `btree_gist`, `pgcrypto`, `citext`, `ltree`, and `pg_trgm` extensions.
21
21
22
22
* If using a schema other than public, ensure that you do not have any other schemas with the extensions enabled, or you must include that in your search path.
23
23
24
24
* Support for pgbouncer and other connection poolers is community-based. Community members have reported that pgbouncer has worked with `pool_mode` = `session` and a suitable setting for `ignore_startup_parameters` (as of writing, `search_path` and `lock_timeout` need to be ignored). Care is needed to avoid polluting connection pools; some level of PostgreSQL expertise is advisable. LangChain Inc currently does not have roadmap plans for formal test coverage or commercial support of pgbouncer or amazon rds proxy or any other poolers, but the community is welcome to discuss and collaborate on support through GitHub issues.
25
25
26
-
* By default, we recommend an instance with at least 2 vCPUs and 8GB of memory. However, the actual requirements will depend on your workload and the number of users you have. We recommend monitoring your PostgreSQL instance and scaling up as needed.
26
+
* By default, we recommend an instance with **at least 2 vCPUs and 8GB of memory**. However, the actual requirements will depend on your workload and the number of users you have. We recommend monitoring your PostgreSQL instance and scaling up as needed.
27
27
28
28
## Connection String
29
29
@@ -33,7 +33,7 @@ You will need to provide a connection string to your PostgreSQL database. This c
33
33
* Port
34
34
* Database
35
35
* Username
36
-
* Password(Make sure to url encode this if there are any special characters)
36
+
* Password(Make sure to url encode this if there are any special characters)
Once configured, you should be able to reinstall your LangSmith instance. If everything is configured correctly, your LangSmith instance should now be using your external PostgreSQL database.
78
+
79
+
## TLS with PostgreSQL
80
+
81
+
Use this section to configure TLS for PostgreSQL connections. For mounting internal/public CAs so LangSmith trusts your PostgreSQL server certificate, see [Configure custom TLS certificates](/langsmith/self-host-custom-tls-certificates#mount-internal-cas-for-tls).
82
+
83
+
### Server TLS (one-way)
84
+
85
+
To validate the PostgreSQL server certificate:
86
+
87
+
- Provide a CA bundle using `config.customCa.secretName` and `config.customCa.secretKey`.
88
+
- Use `sslmode=require` or `sslmode=verify-full`, as well as `sslrootcert=system` to your connection URL.
89
+
90
+
<Warning>
91
+
Mount a custom CA only when your PostgreSQL server uses an internal or private CA. Publicly trusted CAs do not require this configuration.
92
+
</Warning>
93
+
94
+
<CodeGroup>
95
+
96
+
```yaml Helm (server TLS)
97
+
config:
98
+
customCa:
99
+
secretName: "langsmith-custom-ca"# Secret containing your CA bundle
100
+
secretKey: "ca.crt"# Key in the Secret with the CA bundle
As of LangSmith helm chart version **0.12.28**, we support mTLS for PostgreSQL clients. For server-side authentication in mTLS, use the [Server TLS steps](#server-tls-one-way) (custom CA) in addition to the following client certificate configuration.
126
+
127
+
If your PostgreSQL server requires client certificate authentication:
128
+
129
+
- Provide a Secret with your client certificate and key.
130
+
- Reference it via `postgres.external.clientCert.secretName` and specify the keys with `certSecretKey` and `keySecretKey`.
131
+
- Use `sslmode=verify-full` and `sslrootcert=system` in your connection URL.
The certificate volumes mounted for mTLS are protected by file access restrictions. To ensure all LangSmith pods can read the certificate files, you must set `fsGroup: 1000` in the pod security context.
169
+
170
+
You can configure this in one of two ways:
171
+
172
+
**Option 1: Use `commonPodSecurityContext`**
173
+
174
+
Set the `fsGroup` at the top level to apply it to all pods:
175
+
176
+
```yaml
177
+
commonPodSecurityContext:
178
+
fsGroup: 1000
179
+
```
180
+
181
+
**Option 2: Add to individual pod security contexts**
182
+
183
+
If you need more granular control, add the `fsGroup` to each pod's security context individually. See the [mTLS configuration example](https://github.com/langchain-ai/helm/blob/main/charts/langsmith/examples/mtls_config.yaml) for a complete reference.
Copy file name to clipboardExpand all lines: src/langsmith/self-host-external-redis.mdx
+24-5Lines changed: 24 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,7 +252,7 @@ stringData:
252
252
253
253
### Mutual TLS with Client Auth (mTLS)
254
254
255
-
As of LangSmith helm chart version **0.12.26**, we support mTLS for Redis clients. For server-side authentication in mTLS, use the Server TLS steps above (custom CA) in addition to the client certificate configuration below.
255
+
As of LangSmith helm chart version **0.12.28**, we support mTLS for Redis clients. For server-side authentication in mTLS, use the Server TLS steps above (custom CA) in addition to the client certificate configuration below.
256
256
257
257
If your Redis server requires client certificate authentication:
The certificate volumes mounted for mTLS are protected by file access restrictions. To ensure all LangSmith pods can read the certificate files, you must set `fsGroup: 1000` in the pod security context.
309
+
310
+
You can configure this in one of two ways:
311
+
312
+
**Option 1: Use `commonPodSecurityContext`**
313
+
314
+
Set the `fsGroup` at the top level to apply it to all pods:
315
+
316
+
```yaml
317
+
commonPodSecurityContext:
318
+
fsGroup: 1000
319
+
```
320
+
321
+
**Option 2: Add to individual pod security contexts**
322
+
323
+
If you need more granular control, add the `fsGroup` to each pod's security context individually. See the [mtls configuration example](https://github.com/langchain-ai/helm/blob/main/charts/langsmith/examples/mtls_config.yaml) for a complete reference.
0 commit comments