跳到主要内容

为您的安装使用现有密钥 (仅限 Kubernetes)

默认情况下,LangSmith 会配置多个 Kubernetes 密钥来存储敏感信息,例如许可证密钥、盐值和其他配置参数。但是,您可能希望使用已在 Kubernetes 集群中创建(或通过某种密钥操作器配置)的现有密钥。如果您希望以集中方式管理敏感信息或有特定的安全要求,这会很有用。

默认情况下,我们将为 LangSmith 的不同组件配置以下密钥

  • langsmith-secrets:此密钥包含许可证密钥和其他一些基本配置参数。您可以在此处查看此密钥的模板
  • langsmith-redis:此密钥包含 Redis 连接字符串和密码。您可以在此处查看此密钥的模板
  • langsmith-postgres:此密钥包含 Postgres 连接字符串和密码。您可以在此处查看此密钥的模板
  • langsmith-clickhouse:此密钥包含 ClickHouse 连接字符串和密码。您可以在此处查看此密钥的模板

要求

  • 一个现有的 Kubernetes 集群
  • 在您的集群中创建 Kubernetes 密钥的方法。这可以通过 kubectl、Helm Chart 或像 Sealed Secrets 这样的密钥操作器来完成

参数

您需要创建自己的 Kubernetes 密钥,这些密钥必须符合 LangSmith Helm Chart 配置的密钥结构。

警告

密钥必须与 LangSmith Helm Chart 配置的密钥具有相同的结构(请参阅上面的链接以查看具体密钥)。如果您缺少任何必需的键,您的 LangSmith 实例可能无法正常工作。

一个示例密钥可能如下所示

apiVersion: v1
kind: Secret
metadata:
name: langsmith-existing-secrets
namespace: langsmith
stringData:
oauth_client_id: foo
oauth_client_secret: foo
oauth_issuer_url: foo
langsmith_license_key: foo
langgraph_cloud_license_key: foo
api_key_salt: foo
jwt_secret: foo
initial_org_admin_password: foo
blob_storage_access_key: foo
blob_storage_access_key_secret: foo
azure_storage_account_key: foo
azure_storage_connection_string: foo

配置

配置好这些密钥后,您可以将 LangSmith 实例配置为直接使用这些密钥,以避免通过明文传递密钥值。您可以通过修改 LangSmith Helm Chart 安装的 langsmith_config.yaml 文件来完成此操作。


config:
existingSecretName: "langsmith-secrets" # The name of the secret that contains the license key and other basic configuration parameters
redis:
external:
enabled: true # Set to true to use an external Redis instance. This secret is only needed if you are using an external Redis instance
existingSecretName: "langsmith-redis" # The name of the secret that contains the Redis connection string and password
postgres:
external:
enabled: true # Set to true to use an external Postgres instance. This secret is only needed if you are using an external Postgres instance
existingSecretName: "langsmith-postgres" # The name of the secret that contains the Postgres connection string and password
clickhouse:
external:
enabled: true # Set to true to use an external ClickHouse instance. This secret is only needed if you are using an external ClickHouse instance
existingSecretName: "langsmith-clickhouse" # The name of the secret that contains the ClickHouse connection string and password

配置完成后,您需要更新您的 LangSmith 安装。您可以点击此处查看我们的升级指南。如果一切配置正确,您的 LangSmith 实例现在应该可以通过 Ingress 访问。您可以运行以下命令来检查您的密钥是否正确使用

kubectl describe deployment langsmith-backend | grep -i <secret-name>

您应该在输出中看到类似以下内容

POSTGRES_DATABASE_URI:                    <set to the key 'connection_url' in secret <your-secret-name>  Optional: false
CLICKHOUSE_DB: <set to the key 'clickhouse_db' in secret <your-secret-name> Optional: false

此页面有帮助吗?


您可以提供详细反馈 在 GitHub 上.