mongodb-atlas-operator

by MongoDB

Helm chartv2.19.0App 2.19.0

MongoDB Atlas Operator - a Helm chart for installing and upgrading Atlas Operator: the official Kubernetes operator allowing to manage MongoDB Atlas resources from Kubernetes

About this chart

MongoDB Atlas Operator Helm Chart

A Helm chart for installing and upgrading the MongoDB Atlas Operator.

Prerequisites

If required, you can install the Atlas Custom Resource Definitions Helm Chart separately or as a dependency of this Chart.

If the atlas-operator-crds Helm chart has been installed already, or if you don't want to install the CRDs (because you have already installed them), then you need to pass --set mongodb-atlas-operator-crds.enabled=false, when installing the Operator.

Watching over all Namespaces

This will install the Operator in Cluster wide mode. The Operator will watch over all the namespaces in the Kubernetes cluster.

helm install atlas-operator mongodb/mongodb-atlas-operator \
    --namespace=atlas-operator \
    --create-namespace

Watching over same Namespace

This installation mode will restrict the Operator to watch over resources created in the same namespace the Operator is installed.

helm install atlas-operator mongodb/mongodb-atlas-operator \
    --namespace=atlas-operator \
    --set watchNamespaces=atlas-operator \
    --create-namespace

Watching over multiple Namespaces

This installation mode will allow the Operator to watch over resources created in the namespaces specified by the watchNamespaces parameter.

helm install atlas-operator mongodb/mongodb-atlas-operator \
    --namespace=atlas-operator \
    --set watchNamespaces="{ns1,ns2}" \
    --create-namespace

Note: Same thing can be achieved via values.yaml as well.

watchNamespaces:
  - ns1
  - ns2

Watching over all Namespaces with Global Atlas configuration

In this mode the Operator will be installed in Cluster wide mode with Global Atlas configuration.

helm install atlas-operator mongodb/mongodb-atlas-operator \
    --namespace=atlas-operator \
    --create-namespace \
    --set globalConnectionSecret.publicApiKey=<the_public_key> \
    --set globalConnectionSecret.privateApiKey=<the_private_key> \
    --set globalConnectionSecret.orgId=<the_org_id>

Alternatively, you can install the Operator using Atlas Service Account credentials (recommended) instead of an API key:

helm install mongodb-atlas-operator mongodb/mongodb-atlas-operator \
    --set globalConnectionSecret.clientId=<the_client_id> \
    --set globalConnectionSecret.clientSecret=<the_client_secret> \
    --set globalConnectionSecret.orgId=<the_org_id>

Upgrading the Operator:

helm upgrade atlas-operator mongodb/mongodb-atlas-operator

Creating Atlas Resources

After the atlas-operator Helm Chart has been installed, you can proceed to Atlas Cluster Helm Chart to create your first Atlas database.

Deploy mongodb-atlas-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mongodb-atlas-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmongodb-atlas-operator is pinned at v2.19.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply