MongoDB.local SF, Jan 15: See the speaker lineup & ship your AI vision faster. Use WEB50 to save 50%
Find out more >
Menu Docs
Página inicial do Docs
/ /
/ / /

AtlasNetworkContainer Recurso personalizado

Importante

Os subrecursos legados são preteridos a partir do lançamento de seus CRDs correspondentes. Se a sua configuração atualmente depender da forma de subrecurso desta definição de recurso, migre para um CRD.

O recurso personalizado do AtlasNetworkContainer define um contêiner de rede para um projeto Atlas. Você cria VPC conexões de peering entre os containers de rede e as redes que hospedam seus aplicativos.

Importante

Os Recursos Personalizados Não Excluem Mais Objetos por Padrão

  • O Atlas Kubernetes Operator utiliza arquivos de configuração de recurso personalizado para gerenciar sua configuração do Atlas , mas a partir do Atlas Kubernetes Operator,2.0 os recursos personalizados que você exclui no Kubernetes não são mais (por padrão) excluídos no Atlas. Em vez disso, o Atlas Kubernetes Operator simplesmente para de gerenciar estes recursos no Atlas. Por exemplo, se você excluir um AtlasProject Recurso Personalizado no Kubernetes, por padrão, o Atlas Kubernetes Operator não excluirá mais automaticamente o projeto correspondente do Atlas. Essa mudança no comportamento destina-se a ajudar a evitar exclusões acidentais ou inesperadas. Para saber mais, incluindo como reverter este comportamento para o padrão utilizado antes do Atlas Kubernetes Operator.,2 0consulte Novo padrão: Proteção de exclusão no Atlas Kubernetes 2 0Operator..

    Da mesma forma, o Atlas Kubernetes Operator não exclui equipes do Atlas se você as remover de um projeto do Atlas no Kubernetes com o Atlas Kubernetes Operator.

  • Defina explicitamente os detalhes de configuração desejados para evitar o uso implícito de valores de configuração padrão do Atlas . Em alguns casos, herdar os padrões do Atlas pode resultar em um loop de reconciliação que pode impedir que seu recurso personalizado atinja um estado READY. Por exemplo, definir explicitamente o comportamento de autoscaling desejado em seu recurso personalizado AtlasDeployment, conforme mostrado no exemplo incluído, garante que um tamanho de instância estática em seu recurso personalizado não esteja sendo aplicado repetidamente a um sistema do Atlas que tenha o autoscaling ativado.

    autoScaling:
    diskGB:
    enabled: true
    compute:
    enabled: true
    scaleDownEnabled: true
    minInstanceSize: M30
    maxInstanceSize: M40

O Atlas Kubernetes Operator realiza uma das seguintes ações usando o recurso da API de emparelhamento de rede do Atlas :

  • Cria um novo container de rede.

  • Atualiza um container de rede existente.

Os exemplos a seguir ilustram configurações para CRDs do AtlasNetworkContainer.

  • A configuração básica de exemplo define um recurso que você gerencia com a mesma instância do Atlas Kubernetes Operator com a qual você gerencia seu projeto pai do Atlas .

  • O exemplo de CRD independente configura o mesmo container de rede que o exemplo básico, mas para um projeto do Atlas que você gerencia fora da instância do Atlas Kubernetes Operator com a qual você gerencia o container de rede.

O seguinte mostra um recurso personalizado do AtlasNetworkContainer para um contêiner denominado my-atlas-nc que permite criar uma conexão de emparelhamento de VPC entre Atlas e Amazon Web Services dentro do projeto my-project. Para gerenciar esse recurso na mesma instância do Atlas Kubernetes Operator que seu projeto Atlas pai, você deve identificar o projeto com projectRef em vez de externalProjectRef.

apiVersion: atlas.mongodb.com/v1
kind: AtlasNetworkContainer
metadata:
name: my-atlas-nc
spec:
projectRef:
name: my-project
namespace: my-operator-namespace
provider: AWS
id: 66e2f2b7e69a89b66b621571
cidrBlock: 10.11.0.0/16
region: US_EAST_1

O exemplo a seguir mostra um AtlasNetworkContainer CRD independente que habilita o emparelhamento de VPC sob os mesmos parâmetros habilitados pelo exemplo básico. Para habilitar a operação independente, você deve usar um externalProjectRef em vez de um projectRef e deve fornecer um connectionSecret diretamente, pois esse recurso não pode herdar credenciais de API de seu projeto pai.

apiVersion: atlas.mongodb.com/v1
kind: AtlasNetworkContainer
metadata:
name: my-atlas-nc
spec:
externalProjectRef:
projectId: 66e2f2b621571b7e69a89b66
connectionSecret:
name: atlas-connection-secret
provider: AWS
id: 66e2f2b7e69a89b66b621571
cidrBlock: 10.11.0.0/16
region: US_EAST_1

AtlasNetworkContainer is the Schema for the AtlasNetworkContainer API

Name
Tipo
Descrição
Obrigatório

apiVersion

string

atlas.mongodb.com/v1

true

kind

string

AtlasNetworkContainer

true

metadata

objeto

Refer to the Kubernetes API documentation for the fields of the metadata field.

true

spec

objeto

AtlasNetworkContainerSpec defines the target state of an AtlasNetworkContainer. Validations:

  • (has(self.``externalProjectRef``) && !has(self.``projectRef``)) || (!has(self.``externalProjectRef``) && has(self.``projectRef``)): must define only one project reference through externalProjectRef or projectRef

  • (has(self.``externalProjectRef``) && has(self.``connectionSecret``)) || !has(self.``externalProjectRef``): must define a local connection secret when referencing an external project

  • (self.provider == 'GCP' && !has(self.region)) || (self.provider != 'GCP'): must not set region for GCP containers

  • ((self.provider == 'AWS' || self.provider == 'AZURE') && has(self.region)) || (self.provider == 'GCP'): must set region for AWS and Azure containers

  • (self.id == oldSelf.id) || (!has(self.id) && !has(oldSelf.id)): id is immutable

  • (self.region == oldSelf.region) || (!has(self.region) && !has(oldSelf.region)): region is immutable

false

status

objeto

AtlasNetworkContainerStatus is a status for the AtlasNetworkContainer Custom resource. Not the one included in the AtlasProject

false

AtlasNetworkContainerSpec defines the target state of an AtlasNetworkContainer.

Name
Tipo
Descrição
Obrigatório

provider

enum

Provider is the name of the cloud provider hosting the network container. Enum: AWS, GCP, AZURE

true

cidrBlock

string

Atlas CIDR. It needs to be set if ContainerID is not set.

false

connectionSecret

objeto

Name of the secret containing Atlas API private and public keys.

false

externalProjectRef

objeto

externalProjectRef holds the parent Atlas project ID. Mutually exclusive with the "projectRef" field.

false

id

string

ID is the container identifier for an already existent network container to be managed by the operator. This field can be used in conjunction with cidrBlock to update the cidrBlock of an existing container. This field is immutable.

false

projectRef

objeto

projectRef is a reference to the parent AtlasProject resource. Mutually exclusive with the "externalProjectRef" field.

false

region

string

ContainerRegion is the provider region name of Atlas network peer container in Atlas region format This is required by AWS and Azure, but not used by GCP. This field is immutable, Atlas does not admit network container changes.

false

Name of the secret containing Atlas API private and public keys.

externalProjectRef holds the parent Atlas project ID. Mutually exclusive with the "projectRef" field.

Name
Tipo
Descrição
Obrigatório

id

string

ID is the Atlas project ID.

true

projectRef is a reference to the parent AtlasProject resource. Mutually exclusive with the "externalProjectRef" field.

Name
Tipo
Descrição
Obrigatório

name

string

Name of the Kubernetes Resource

true

namespace

string

Namespace of the Kubernetes Resource

false

AtlasNetworkContainerStatus is a status for the AtlasNetworkContainer Custom resource. Not the one included in the AtlasProject

Name
Tipo
Descrição
Obrigatório

conditions

[]object

Conditions is the list of statuses showing the current state of the Atlas Custom Resource

true

id

string

ID record the identifier of the container in Atlas

false

observedGeneration

inteiro

ObservedGeneration indicates the generation of the resource specification of which the Atlas Operator is aware. The Atlas Operator updates this field to the value of 'metadata.generation' as soon as it starts reconciliation of the resource. Format: int64

false

provisioned

booleano

Provisioned is true when clusters have been deployed to the container before the last reconciliation

false

Condition describes the state of an Atlas Custom Resource at a certain point.

Name
Tipo
Descrição
Obrigatório

status

string

Status of the condition; one of True, False, Unknown.

true

type

string

Type of Atlas Custom Resource condition.

true

lastTransitionTime

string

Last time the condition transitioned from one status to another. Represented in ISO 8601 format. Format: date-time

false

message

string

A message providing details about the transition.

false

reason

string

The reason for the condition's last transition.

false

Voltar

AtlasIPAccessList

Nesta página