对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

配置 Kubernetes 以部署 MongoDB 资源

You can use the MongoDB Enterprise Kubernetes Operator to deploy MongoDB resources such as a replica set, a sharded cluster, or a standalone instance using an object. Ops Manager can generate the YAML files you need to configure your Kubernetes environment for deploying a MongoDB Database resource.

要生成 YAML 文件:

您必须具有以下角色之一才能访问 Ops Manager 用户界面以设置 Kubernetes:

要创建或链接 Ops Manager 项目,MongoDB Enterprise Kubernetes Operator 要求您配置 Kubernetes ConfigMap。使用 Kubernetes ConfigMap,您可以:

  • 连接使用自定义证书颁发机构且启用了 HTTPS 的 Ops Manager,或者

  • 链接到未使用自定义证书颁发机构的 Ops Manager 项目。

您可以使用 Ops Manager Kubernetes Setup 页面自动生成 ConfigMap。为 ConfigMap 生成的 YAML 文件如下所示:

要在 Ops Manager 项目中创建或更新对象,请将编程 API 密钥配置为 Kubernetes 密钥。该密钥存储身份验证凭证,因此只有 Kubernetes 才能访问它们。

以下程序提供了详细步骤。

要在 Ops Manager UI 中访问 Kubernetes Setup 页面,请执行以下操作:

1
2
3

如果您是 Global OwnerOrganization Owner,则还可以通过以下步骤访问 Ops Manager UI 中的 Kubernetes Setup 页面:

1
2

要为 Kubernetes 创建密钥、ConfigMap 文件和 Ops Manager 设置:

1

/mongodb-ops-manager/ 文件夹中创建包含编程 API 密钥的 YAML 文件。

2

Create a YAML file that contains the ConfigMap to connect to your HTTPS-enabled Ops Manager instance in the /mongodb-ops-manager/ folder.

3

在服务器的 conf-mms.properties 文件中,配置以下设置:

  • kubernetes.templates.credentialsFilePathYAML 文件的路径,其中包含用于链接到 Ops Manager 项目的 ConfigMap。此文件必须采用 YAML 格式,并且必须存储在 /mongodb-ops-manager/ 目录下。该文件对应于 Kubernetes ConfigMap Setup

  • kubernetes.templates.projectFilePath. Path to the YAML file that contains your Programmatic API Key as a Kubernetes secret to create or update objects in your Ops Manager project. This file must be in YAML format and must be stored under the /mongodb-ops-manager/ directory. The file corresponds to Kubernetes Secret Setup.

要了解更多信息,请参阅 Kubernetes 设置。

为 MongoDB 资源生成 Kubernetes 配置文件: