重要
旧版子资源自相应的 CRD发布以来已被弃用。如果您的配置当前依赖于此资源定义的子资源形式,迁移到 CRD。
AtlasNetworkPeering自定义资源定义了Atlas项目的网络对等连接。网络对等连接将流量与公共网络隔离以提高安全性。
重要
自定义资源不再默认删除对象
Atlas Kubernetes Operator使用自定义资源配置文件来管理Atlas配置,但从Atlas Kubernetes Operator2.0 开始,您在Kubernetes中删除的自定义资源不再(默认)在Atlas中删除。相反, Atlas Kubernetes Operator只是停止管理Atlas中的这些资源。
AtlasProject示例,如果您在Kubernetes中删除 自定义资源,默认默认, Atlas Kubernetes Operator不再自动从Atlas中删除相应的项目。这种行为更改旨在帮助防止意外删除。 要学习;了解详情,包括如何将此行为恢复为在Atlas Kubernetes Operator.2 0之前使用的默认,请参阅新默认值: Atlas Kubernetes2 Operator.0 中的删除保护。同样,如果您使用Atlas Kubernetes Operator从Kubernetes中的Atlas项目中删除团队,则Atlas Kubernetes Operator不会从Atlas中删除团队。
显式定义所需的配置详细信息,以避免隐式使用默认Atlas配置值。 在某些情况下,继承Atlas默认值可能会导致协调循环,从而阻止自定义资源实现
READY状态。 示例,在AtlasDeployment自定义资源中显式定义所需的自动伸缩行为(如所包含的示例所示)可确保自定义资源中的静态实例大小不会重复应用于已启用自动伸缩的Atlas部署。autoScaling: diskGB: enabled: true compute: enabled: true scaleDownEnabled: true minInstanceSize: M30 maxInstanceSize: M40
Atlas Kubernetes Operator does one of the following actions using the Atlas Network Peering API Resource:
创建新的网络对等连接。
更新现有网络对等连接。
注意
一个网络对等连接只能属于一个项目。要为多个项目定义相同的网络对等连接,请为每个项目创建自定义资源定义。
示例
以下示例说明了 AtlasNetworkPeering CRD 的配置。
基本示例配置定义了一个资源,您可以使用管理其父Atlas项目的同一Atlas Kubernetes Operator实例来管理该资源。
独立 CRD示例配置与基本示例相同的VPC对等连接,但适用于您在管理VPC对等连接的Atlas Kubernetes Operator实例外部管理的Atlas项目。
基本示例
以下示例显示一个 AtlasNetworkPeering 自定义资源,定义了 my-project 项目 VPC 和您的 AWS VPC 之间的 green-leaf-peering 连接。要在与其父 Atlas 项目相同的 Atlas Kubernetes Operator 实例中管理此资源,您必须使用 projectRef 而不是 externalProjectRef 来标识该项目。
apiVersion: atlas.mongodb.com/v1 kind: AtlasNetworkPeering metadata: name: green-leaf-peering spec: projectRef: name: my-project namespace: my-operator-namespace containerRef: id: 72a6d2a69388ba121943ae27 id: 72a6d2a69388ba121943ae27 provider: AWS awsConfiguration: accepterRegionName: us-east-1 awsAccountId: 389226183042 routeTableCiderBlock: 10.0.0.0/21 vpcId: vpc-abc
独立 CRD 示例
The following example shows an AtlasNetworkPeering independent CRD that configures the same VPC peering connection defined by the Basic Example. To enable resource management independent of the parent project, you must use an externalProjectRef instead of a projectRef, and you must supply a connectionSecret directly since this resource can't inherit API credentials from its parent project.
apiVersion: atlas.mongodb.com/v1 kind: AtlasNetworkPeering metadata: name: green-leaf-peering spec: externalProjectRef: projectId: 66e2f2b621571b7e69a89b66 connectionSecret: name: atlas-connection-secret containerRef: id: 72a6d2a69388ba121943ae27 id: 72a6d2a69388ba121943ae27 provider: AWS awsConfiguration: accepterRegionName: us-east-1 awsAccountId: 389226183042 routeTableCiderBlock: 10.0.0.0/21 vpcId: vpc-abc
参数
AtlasNetworkPeering
AtlasNetworkPeering 是 AtlasNetworkPeering API 的模式
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | atlas.mongodb.com/v1 | true |
| 字符串 |
| true |
| 对象 | 有关 | true |
| 对象 |
| false |
| 对象 |
| false |
AtlasNetworkPeering.spec
AtlasNetworkPeeringSpec 定义了 AtlasNetworkPeering 的目标省/市/自治区。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 对象 |
| true |
| 枚举 | 要为其创建网络对等互连服务的云服务 | true |
| 对象 | AWSConfiguration 是网络对等互连的特定 | false |
| 对象 |
| false |
| 对象 | 包含Atlas | false |
| 对象 |
| false |
| 对象 | GCPConfiguration 是针对网络对等互连的特定 Google Cloud 设置。 | false |
| 字符串 |
| false |
| 对象 |
| false |
AtlasNetworkPeering.spec.containerRef
ContainerDualReference 通过 Kubernetes 名称或 Atlas ID 指代网络容器。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| false |
| 字符串 | 容器Kubernetes资源的名称,必须存在于同一命名空间中。使用 | false |
AtlasNetworkPeering.spec.awsConfiguration
AWSConfiguration 是网络对等互连的特定 AWS 设置。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| true |
| 字符串 |
| true |
| 字符串 | 用户 | true |
| 字符串 |
| true |
AtlasNetworkPeering.spec.azureConfiguration
AzureConfiguration 是网络对等互连的特定 Azure 设置。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| true |
| 字符串 |
| true |
| 字符串 |
| true |
| 字符串 | VNetName 是 Azure VNet 的名称。它仅适用于Azure。 | true |
AtlasNetworkPeering.spec.connectionSecret
包含Atlas API私钥和公钥的密钥名称。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | true |
AtlasNetworkPeering.spec.externalProjectRef
externalProjectRef 保存父Atlas群组 ID(group ID)。与 "projectRef"字段互斥。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| true |
AtlasNetworkPeering.spec.gcpConfiguration
GCPConfiguration 是针对网络对等互连的特定 Google Cloud 设置。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | 用户 | true |
| 字符串 |
| true |
AtlasNetworkPeering.spec.projectRef
projectRef 是对父 AtlasProject资源的引用。与 "externalProjectRef"字段互斥。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | Kubernetes资源名称 | true |
| 字符串 | Kubernetes资源的命名空间 | false |
AtlasNetworkPeering.status
AtlasNetworkPeeringStatus 是 AtlasNetworkPeering 自定义资源的状态。不是 AtlasProject 中包含的
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| []对象 | 条件是显示Atlas自定义资源当前省/市/自治区的列表 | true |
| 对象 | AWSStatus 仅包含 | false |
| 对象 |
| false |
| 对象 | GCPStatus 仅包含 | false |
| 字符串 |
| false |
| 整型 |
| false |
| 字符串 | 状态描述了网络对等互连设置的最后 | false |
AtlasNetworkPeering.status.conditions
条件描述了Atlas自定义资源在某一点的省/市/自治区。
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | 条件的状态; True、False、未知之一。 | true |
| 字符串 | Atlas自定义资源条件的类型。 | true |
| 字符串 | 上次条件从一种状态转换为另一种状态的时间。以 | false |
| 字符串 | 提供有关转换的详细信息的 | false |
| 字符串 | 条件的最后一次转换的 | false |
AtlasNetworkPeering.status.awsStatus
AWSStatus 包含仅与 AWS 相关的状态信息
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| false |
| 字符串 |
| false |
AtlasNetworkPeering.status.azureStatus
AzureStatus 包含仅与Azure相关的状态信息
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 |
| false |
| 字符串 |
| false |
AtlasNetworkPeering.status.gcpStatus
GCPStatus 包含仅与GCP相关的状态信息
Name | 类型 | 说明 | 必需 |
|---|---|---|---|
| 字符串 | GCPProjectID 是Atlas端的 | false |
| 字符串 |
| false |