Docs Menu

AtlasNetworkPeering カスタム リソース

The AtlasNetworkPeering custom resource defines a network peering connection for a Atlas project. Network peering connections isolate traffic from public networks for added security.

重要

カスタム リソースはデフォルトでオブジェクトを削除しなくなりました

  • Atlas Kubernetes Operator はカスタムリソース構成ファイルを使用して Atlas 構成を管理しますが、Atlas Kubernetes Operator2.0 以降、 Kubernetesで削除したカスタム リソースは Atlas で削除されなくなりました(デフォルトでは )。代わりに、Atlas Kubernetes Operator は Atlas 内のそれらのリソースの管理を停止します。 例、 Kubernetesで カスタム リソースを削除すると、デフォルトでは、Atlas Kubernetes Operator は AtlasAtlasProject から対応するプロジェクトを自動的に削除しなくなります。この動作の変更は、誤ってまたは予期せずに削除されるのを防ぐことを目的としています。 この動作を Atlas Kubernetes Operator. 以前に使用されていたデフォルトに戻す方法などの詳細については、「2 0新しいデフォルト: Atlas Kubernetes Operator. の削除保護2 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 演算子 does one of the following actions using the Atlas Network Peering API Resource:

  • Creates a new network peering connection.

  • Updates an existing network peering connection.

注意

A network peering connection can belong only to one project. To define the same network peering connection for multiple projects, create custom resource definitions for each project.

The following examples illustrate configurations for AtlasNetworkPeering CRDs.

  • The basic example configuration defines a resource that you manage with the same Atlas Kubernetes Operator instance with which you manage its parent Atlas project.

  • The Independent CRD example configures the same VPC peering connection as the basic example, but for a Atlas project that you manage outside of the Atlas Kubernetes Operator instance with which you manage the VPC peering connection.

The following example shows an AtlasNetworkPeering custom resource that defines the green-leaf-peering connection between the my-project project VPC and your Amazon Web Services VPC. To manage this resource in the same Atlas Kubernetes Operator instance as its parent Atlas project, you must identify the project with projectRef instead of 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

The following example shows an AtlasNetworkPeering independent CRD that configures the same VPC peering connection defined by the 基本的な例. 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

This section describes the AtlasNetworkPeering parameters available in this custom resource definition.

metadata.name

: string

必須

Name that the AtlasNetworkPeering カスタム リソース uses to add this network peering connection to a project.

metadata.namespace

: string

任意

AtlasNetworkPeering カスタムリソースを含める default 以外の名前空間。

spec.connectionSecret.name

: string

条件付き

Name of the opaque secret that contains the organization ID and API keys that Atlas Kubernetes Operator uses to 接続 to Atlas. If unspecified, Atlas Kubernetes Operator defaults to one of the following options:

  • atlasProjectspec.connectionSecretRef.name パラメータ

  • The default global secret, if you haven't defined the spec.connectionSecretRef.name for the parent atlasProject

このパラメータは独立した CRD に必要です。

Atlas Kubernetes Operator atlas.mongodb.com/type=credentialsは、不要な シークレット の監視を回避するために、ラベル の シークレット のみを監視します 。

次の例ではシークレットにラベルを付けます。

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.containerRef.id

: string

条件付き

If this resource represents a new network peering connection, omit this parameter.

ID of the existing network peering container. Provide this field only if you want this resource to manage an existing network peering connection within Atlas Kubernetes Operator. If you prefer that this resource starts managing a Kubernetes local resource, use the spec.containerRef.name parameter.

spec.containerRef.name

: string

条件付き

Name of an existing network peering container which you manage with a Kubernetes local resource in your project namespace. Provide this field only if you want this resource to manage a Kubernetes local resource. If you prefer that this resource starts managing a network peering connection already managed by Atlas Kubernetes Operator, use the spec.containerRef.id parameter. If this resource represents a new network peering connection, omit this field.

spec.externalProjectRef.id

: string

条件付き

ID of the project to which the network peering connection belongs. You must specify the project ID of an existing Atlas Project. You must specify this parameter for network peering connections that belong to projects managed by either:

  • Atlas Kubernetes Operator の別のインスタンス

  • Atlas Kubernetes Operator 以外のツール

For deployments that belong to projects managed by the same instance of Atlas Kubernetes Operator, use spec.projectRef.name. These parameters are mutually exclusive with each other.

A network peering connection can belong to only one project. To define the same network peering connection for multiple projects, create custom resource definitions for each project.

spec.projectRef.name

: string

条件付き

Name of the project to which the network peering connection belongs. You must specify an existing AtlasProject カスタム リソース. This parameter applies only to network peering connections that belong to projects managed by the same instance Atlas Kubernetes Operator.

次のいずれかによって管理されるプロジェクトに属する配置の場合、次のいずれかによって管理されます。

  • Atlas Kubernetes Operator の別のインスタンス

  • Atlas Kubernetes Operator 以外のツール

use spec.externalProjectRef.id. These parameters are mutually exclusive with each other.

A network peering connection can belong only to one project. To define the same network peering connection for multiple projects, create custom resource definitions for each project.

spec.projectRef.namespace

: string

条件付き

で指定されたAtlasProject カスタム spec.projectRef.nameリソースが存在する名前空間。

次のいずれかによって管理されるプロジェクトに属する配置では、このパラメーターを設定しないでください。

  • Atlas Kubernetes Operator の別のインスタンス

  • Atlas Kubernetes Operator 以外のツール

spec.id

: string

条件付き

Unique identifier of the existing network peering connection within Atlas. This parameter is required for and limited to scenarios in which Atlas Kubernetes Operator assumes management of a pre-existing network peering connection.

spec.provider

: string

必須

Cloud provider with which to establish a VPC peering connection. Must be one of the following:

  • AWS

  • Azure

  • GCP

spec.awsConfiguration.accepterRegionName

: string

条件付き

Amazon Web Services region to which to establish a VPC peering connection. Required for and limited to Amazon Web Services connections.

spec.awsConfiguration.awsAccountId

: string

条件付き

Unique identifier of the Amazon Web Services account to which the connection belongs. Required for and limited to Amazon Web Services connections.

spec.awsConfiguration.routeTableCidrBlock

: string

条件付き

CIDR block of your Amazon Web Services VPC. Required for and limited to Amazon Web Services connections.

spec.awsConfiguration.vpcId

: string

条件付き

Unique identifier of your Amazon Web Services VPC. Required for and limited to Amazon Web Services connections.

spec.azureConfiguration.azureDirectoryId

: string

条件付き

Unique identifier of your Azure directory. Required for and limited to Azure connections.

spec.azureConfiguration.azureSubscriptionId

: string

条件付き

Unique identifier of your Azure subscription. Required for and limited to Azure connections.

spec.azureConfiguration.resourceGroupName

: string

条件付き

Name of the Azure Resource Group to which the connection belongs. Required for and limited to Azure connections.

spec.azureConfiguration.vNetName

: string

条件付き

Name of your Azure Virtual Network. Required for and limited to Azure connections.

spec.gcpConfiguration.gcpProjectId

: string

条件付き

Name of your Google Cloud Google project. Required for and limited to Google Cloud connections.

spec.gcpConfiguration.networkName

: string

条件付き

Name of your Google Cloud network. Required for and limited to Google Cloud connections.