重要
レガシー サブリソースは、対応する CRD のリリース時点で非推奨となります。構成が現在、このリソース定義のサブリソース形式に依存している場合は、CRD に移行します。
AtlasPrivateEndpointカスタムリソースは、 Atlasプロジェクトのプライベートエンドポイントを構成します。これにより、パブリック ネットワーク経由で情報を送信せずに、クラウドプロバイダーをAtlas に接続できるようになります。プライベートエンドポイントは、仮想ネットワークから Atlasへの一方向接続です。
重要
カスタム リソースはデフォルトでオブジェクトを削除しなくなりました
Atlas Kubernetes Operator はカスタムリソース構成ファイルを使用して Atlas 構成を管理しますが、Atlas Kubernetes Operator2.0 以降、 Kubernetesで削除したカスタム リソースは Atlas で削除されなくなりました(デフォルトでは )。代わりに、Atlas Kubernetes Operator は Atlas 内のそれらのリソースの管理を停止します。 例、 Kubernetesで カスタム リソースを削除すると、デフォルトでは、Atlas Kubernetes Operator は Atlas
AtlasProjectから対応するプロジェクトを自動的に削除しなくなります。この動作の変更は、誤ってまたは予期せずに削除されるのを防ぐことを目的としています。 この動作を 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 Operator は、Atlas プライベートエンドポイント サービスAPIリソースを使用して次のいずれかのアクションを実行します。
新しいプライベートエンドポイント サービスを作成します。
既存のプライベートエンドポイント サービスを更新します。
Atlas Kubernetes Operator でプライベート エンドポイントを実装する方法の詳細については、プライベート エンドポイントの管理 を参照してください。
例
基本的な例
次の例は、my-projectプロジェクト内でAmazon Web Servicesのプライベートエンドポイントを定義するAtlasPrivateEndpointカスタムリソースを示しています。
apiVersion: atlas.mongodb.com/v1 kind: AtlasPrivateEndpoint metadata: name: my-atlas-pe1 spec: projectRef: name: my-project namespace: my-operator-namespace provider: AWS region: us-east-1 awsConfiguration: - id: vpcpe-xyz
独立した CRD の例
The following example shows an AtlasPrivateEndpoint independent CRD that defines the same private endpoint defined in the Basic Example. This custom resource definition allows you to create this private endpoint in a project you don't manage in the same instance of Atlas Kubernetes Operator with which you define this resource. To enable independent operation, 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: AtlasPrivateEndpoint metadata: name: my-atlas-pe1 spec: externalProjectRef: projectID: 66e2f2b621571b7e69a89b66 connectionSecret: name: atlas-connection-secret provider: AWS region: us-east-1 awsConfiguration: - id: vpcpe-xyz
パラメーター
このセクションでは、使用可能なAtlasPrivateEndpointカスタム リソース パラメータについて説明します。
metadata.name型: string
必須
Name that the
AtlasPrivateEndpointCustom Resource uses to add this private endpoint to a project.
metadata.namespace型: string
任意
AtlasPrivateEndpointカスタムリソースを含める名前空間。指定されていない場合、Atlas Kubernetes Operator はkubectlによって設定された現在の名前空間を使用します。カスタム名前空間を定義する場合は、 フィールドの
AtlasProjectカスタムspec.privateEndpoint.privateEndpointRef.namespaceリソースに追加する必要があります。
spec.awsConfiguration.id型: string
条件付き
プライベートエンドポイント ネットワーク インターフェイスのID 。このパラメータは必須であり、Amazon Web Services のプライベートエンドポイントに限定されます。
spec.azureConfiguration.id型: string
条件付き
プライベートエンドポイント ネットワーク インターフェイスのID 。このパラメーターは Azure プライベート エンドポイントでは必須であり、 Azureプライベート エンドポイントに限定されます。
spec.azureConfiguration.ipAddress型: string
条件付き
Azure VNet 内のプライベートエンドポイントのIPアドレス。このパラメーターは Azure プライベート エンドポイントでは必須であり、 Azureプライベート エンドポイントに限定されます。
spec.connectionSecret.name型: string
条件付き
Atlas Kubernetes Operator が Atlas に接続するために使用する組織IDとAPIキーを含む opaque secret の名前。指定されていない場合、Atlas Kubernetes Operator は次のいずれかにフォールバックします。
親
atlasProjectのspec.connectionSecretRef.nameパラメータデフォルトの
globalシークレット(親atlasProjectに対してspec.connectionSecretRef.nameが未定義の場合)
このパラメータは独立した CRD に必須です。
Atlas Kubernetes Operator
atlas.mongodb.com/type=credentialsは、不要な シークレット の監視を回避するために、ラベル のシークレットのみを監視します。次の例ではシークレットにラベルを付けます。
kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.externalProjectRef.id型: string
条件付き
ID of the project to which the private endpoint belongs. You must specify the project ID of an existing Atlas Project. This parameter is required for private endpoints that belong to projects managed by either:
Atlas Kubernetes Operator の別のインスタンス
Atlas Kubernetes Operator 以外のツール
Atlas Kubernetes Operator の同じインスタンスによって管理されるプロジェクトに属する配置では、
spec.externalProjectRef.idを使用しない場合はspec.projectRef.nameを使用します。プライベートエンドポイントは 1 つのプロジェクトにのみ属することができます。 複数のプロジェクトに同じプライベートエンドポイントを定義するには、プロジェクトごとにカスタムリソース定義 を作成します。
spec.gcpConfiguration.endpointsタイプ: 配列
条件付き
このエンドポイントグループを構成する個々のプライベートエンドポイントのリスト。 このパラメータは、 Google Cloud Platformプライベートエンドポイントに限定されます。
spec.gcpConfiguration.endpoints.[n].ipAddress型: string
条件付き
指定されたGoogle Cloud Platformプライベートエンドポイントが解決するIPアドレス。 このパラメータは、 Google Cloud Platformプライベートエンドポイントに限定されます。
spec.gcpConfiguration.endpoints.[n].name型: string
条件付き
特定のGoogle Cloud Platformプライベートエンドポイントを一意に識別する名前。 このパラメータは、 Google Cloud Platformプライベートエンドポイントに限定されます。
spec.gcpConfiguration.groupName型: string
条件付き
Google Cloud Platformプライベートエンドポイントのセットを一意に識別する名前。 このパラメータは、 Google Cloud Platformプライベートエンドポイントに限定されます。
spec.projectRef.name型: string
条件付き
プライベートエンドポイントが属するプロジェクトの名前。 既存の
AtlasProjectカスタム リソース を指定する必要があります。このパラメーターは、同じインスタンスAtlas Kubernetes Operator によって管理されるプロジェクトに属するプライベートエンドポイントにのみ適用されます。次のいずれかによって管理されるプロジェクトに属するプライベートエンドポイントの場合。
Atlas Kubernetes Operator の別のインスタンス
Atlas Kubernetes Operator 以外のツール
spec.externalProjectRef.idを使用します。プライベートエンドポイントは 1 つのプロジェクトにのみ属することができます。 複数のプロジェクトに同じプライベートエンドポイントを定義するには、プロジェクトごとにカスタムリソース定義 を作成します。
spec.projectRef.namespace型: string
条件付き
で指定された
AtlasProjectカスタムspec.projectRef.nameリソースが存在する名前空間。次のいずれかによって管理されるプロジェクトに属する配置の場合、次のいずれかによって管理されます。
Atlas Kubernetes Operator の別のインスタンス
Atlas Kubernetes Operator 以外のツール
このパラメーターを設定しないでください。