Docs Menu
Docs Home
/
MongoDB Cloud Manager
/ /

Configure Kubernetes for Deploying MongoDB Resource

On this page

  • Verify Permissions
  • Navigate to the Kubernetes Setup Page in the Cloud Manager UI
  • Set Up Kubernetes for a MongoDB Resource

You can use the Kubernetes Operator to deploy MongoDB resources such as a replica set, a sharded cluster, or a standalone instance using an object. Cloud Manager can generate the YAML files you need to configure your Kubernetes environment for deploying a MongoDB Database resource.

To generate the YAML files:

You must have one of the following roles to access the Cloud Manager UI for setting up Kubernetes:

To access the Kubernetes Setup page in the Cloud Manager UI:

1
2
3

If you are a Global Owner or Organization Owner, you can access the Kubernetes Setup page in the Cloud Manager UI by doing the following also:

1
  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Click the Organization Settings icon next to the Organizations menu.

    The Organization Settings page displays.

2

Click Kubernetes Setup in the sidebar.

The Kubernetes Setup page displays.

The MongoDB Enterprise Kubernetes Operator requires a Kubernetes ConfigMap to create or link your Cloud Manager project.

You can use the Cloud Manager Kubernetes Setup page to automatically generate the ConfigMap. The generated YAML file for the ConfigMap looks similar to the following:

apiVersion: v1
kind: ConfigMap
metadata:
name: my-project
namespace: mongodb
data:
baseUrl: https://cloud.mongodb.com
# Optional Parameters
# projectName: <your-project-name>
orgId: <your-org-id>

You need to store your Programmatic API Key as a Kubernetes secret to create or update Kubernetes objects in your Cloud Manager project. A Kubernetes secret stores authentication credentials so only Kubernetes can access them.

You can specify your existing API keys or generate new API keys to create the Kubernetes secret in the Cloud Manager Kubernetes Setup page. The generated YAML file for the secret looks similar to the following:

apiVersion: v1
kind: Secret
metadata:
name: organization-secret
namespace: mongodb
stringData:
user: <private-key>
publicApiKey: <public-api-key>

To setup Kubernetes for a MongoDB resource:

1
  • Click Create New API Keys to generate new API keys.

  • Click Use Existing API Keys to specify your existing public and private keys.

2
3

To generate the ConfigMap and Kubernetes secret YAML files:

  • Click Generate Key and YAML if you are generating new API keys.

  • Click Generate YAML if you are using existing API keys.

4

Back

Deploy with Kubernetes