ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs 菜单

Atlas Kubernetes 配置生成

生成 Kubernetes 配置资源以与 Atlas Kubernetes Operator 一起使用。

此命令以 Kubernetes 兼容格式导出Atlas对象的配置,包括项目、部署和用户,以便您使用Atlas Kubernetes Operator管理这些资源。 有关更多信息,请参阅https://www.mongodb.com/zh-cn/docs/atlas/atlas-operator/

命令语法
atlas kubernetes config generate [options]
名称
类型
必需
说明

--clusterName

字符串

false

要导入的一个或多个以逗号分隔的集群名称

--dataFederationName

字符串

false

要导入的一个或多个以逗号分隔的Data Federation名称

-h,--help

false

生成帮助

--includeSecrets

false

使用项目、用户、部署实体的数据生成 Kubernetes 密钥的标志。

--independentResources

false

标志,使支持独立使用的生成资源使用外部 ID 而不是Kubernetes引用。

--operatorVersion

字符串

false

要为其生成资源的 Atlas Kubernetes Operator 版本。 该值默认为 " 2.7.0 "。

--orgId

字符串

false

要使用的组织 ID。 此选项会覆盖配置文件或环境变量中的设置。

--projectId

字符串

false

标识要使用的项目的十六进制字符串。 此选项会覆盖配置文件或环境变量中的设置。

--targetNamespace

字符串

false

用于生成的 Kubernetes 实体的命名空间

名称
类型
必需
说明

-P, --profile

字符串

false

要从配置文件中使用的配置文件的名称。 要了解 Atlas CLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings。

# Export Project, DatabaseUsers, Deployments resources for a specific project without connection and integration secrets:
atlas kubernetes config generate --projectId=<projectId>
# Export Project, DatabaseUsers, Deployments resources for a specific project, but use external IDs where supported:
atlas kubernetes config generate --projectId=<projectId> --independentResources
# Export Project, DatabaseUsers, Deployments resources for a specific project including connection and integration secrets:
atlas kubernetes config generate --projectId=<projectId> --includeSecrets
# Export Project, DatabaseUsers, Deployments resources for a specific project including connection and integration secrets to a specific namespace:
atlas kubernetes config generate --projectId=<projectId> --includeSecrets --targetNamespace=<namespace>
# Export Project, DatabaseUsers, DataFederations and specific Deployment resources for a specific project including connection and integration secrets to a specific namespace:
atlas kubernetes config generate --projectId=<projectId> --clusterName=<cluster-name-1, cluster-name-2> --includeSecrets --targetNamespace=<namespace>
# Export resources for a specific version of the Atlas Kubernetes Operator:
atlas kubernetes config generate --projectId=<projectId> --targetNamespace=<namespace> --operatorVersion=1.5.1
# Export Project, DatabaseUsers, Clusters and specific DataFederation resources for a specific project to a specific namespace:
atlas kubernetes config generate --projectId=<projectId> --dataFederationName=<data-federation-name-1, data-federation-name-2> --targetNamespace=<namespace>