Docs Menu
Docs Home
/
MongoDB Ops Manager
/ /

Configure Kubernetes for Deploying MongoDB Resource

On this page

  • Verify Permissions
  • Overview of MongoDB Resource in Kubernetes
  • Procedures

You can use the MongoDB Enterprise Kubernetes Operator to deploy MongoDB resources such as a replica set, a sharded cluster, or a standalone instance using an object. Ops 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 Ops Manager UI for setting up Kubernetes:

To create or link your Ops Manager project, the MongoDB Enterprise Kubernetes Operator requires that you configure a Kubernetes ConfigMap. Using the Kubernetes ConfigMap, you can:

  • Connect to a HTTPS-enabled Ops Manager that is using a custom Certificate Authority, or

  • Link to a Ops Manager project that isn't using a custom Certificate Authority.

You can use the Ops 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>
sslMMSCAConfigMap: <root-ca-configmap-name>
sslRequireValidMMSServerCertificates: 'true'
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>

To create or update objects in your Ops Manager project, configure your Programmatic API Key as a Kubernetes secret. The secret stores authentication credentials so only Kubernetes can access them.

The following procedures provide the detailed steps.

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

1
2
3

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

1
2

To create a secret, a ConfigMap file, and Ops Manager settings for Kubernetes:

1

Create a YAML file that contains your Programmatic API Key in the /mongodb-ops-manager/ folder.

2

Create a YAML file that contains the ConfigMap to connect to your HTTPS-enabled Ops Manager instance in the /mongodb-ops-manager/ folder.

3

In your server's conf-mms.properties file, configure the following settings:

  • kubernetes.templates.credentialsFilePath. Path to the YAML file that contains the ConfigMap to use to link to your Ops Manager project. This file must be in YAML format and must be stored under the /mongodb-ops-manager/ directory. The file corresponds to Kubernetes ConfigMap Setup.

  • kubernetes.templates.projectFilePath. Path to the YAML file that contains your Programmatic API Key as a Kubernetes secret to create or update objects in your Ops Manager project. This file must be in YAML format and must be stored under the /mongodb-ops-manager/ directory. The file corresponds to Kubernetes Secret Setup.

To learn more, see Kubernetes Setup.

To generate the Kubernetes configuration files for a MongoDB resource:

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

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

5

If you disabled the mms.publicApi.whitelistEnabled setting in your Ops Manager configuration, the Access List Entry field is not visible in the UI.

6

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.

7
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

If you disabled the mms.publicApi.whitelistEnabled setting in your Ops Manager configuration, the Access List Entry field is not visible in the UI.

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 MongoDB Resources Using Kubernetes

Next

Deploy a BI Connector Instance