- Install and Configure the Kubernetes Operator >
- Configure the Kubernetes Operator for MongoDB Resources >
- Create a Project using a ConfigMap
Create a Project using a ConfigMap¶
On this page
The MongoDB Enterprise Kubernetes Operator uses a Kubernetes ConfigMap to create or link your Ops Manager Project. To create a Kubernetes Operator ConfigMap, you need to edit a few lines of the example ConfigMap YAML file and apply the ConfigMap.
Prerequisites¶
Procedure¶
Copy the following example ConfigMap.¶
Update the values in the lines highlighted in the example ConfigMap.¶
Key | Type | Description | Example |
---|---|---|---|
metadata.name |
string | Label for a Kubernetes object. See also
|
myconfigmap |
metadata.namespace |
string | Scope of object names. Used to limit what can be managed to
a subset of all objects. The default value is Important The Kubernetes Operator, secret, and MongoDB Kubernetes resources must be created in the same namespace. See also
|
mongodb |
data.projectName |
string | Label for your Ops Manager Project. Let Kubernetes Operator create the Project The Kubernetes Operator creates the Ops Manager Project if it does not exist. It is strongly recommended to use the Operator to create a new Project for Kubernetes to manage. The Operator adds additional internal information to Projects that it creates. If you omit the If you need or want to use an existing Project, you can find
the |
Development |
data.orgId |
string | 24 character hex string that uniquely identifies your
MongoDB Organization.
You can find the
Important This field is optional. If you omit the You must have the Limited to Cloud Manager or Ops Manager Organizations If you set this value, it can be for a Cloud Manager or Ops Manager organization only. If you try to use an Atlas organization, the Kubernetes Operator may not work as intended. |
5cc9b333dd3e384a625a6615 |
data.baseUrl |
string | URL to your Ops Manager Application including the FQDN and port number. Note You may use Cloud Manager for the |
https://ops.example.com:8443 |
Save this file with a .yaml
file extension.¶
Invoke the Kubernetes command to create your ConfigMap.¶
Important
All subsequent kubectl
commands you invoke must add the
-n
option with the metadata.namespace
you
specified in your ConfigMap.
Invoke the Kubernetes command to verify your ConfigMap.¶
Always include the namespace option with kubectl
kubectl
defaults to an empty namespace if you do not specify
the -n
option, resulting in deployment failures. You must
specify the value of the <metadata.namespace>
field.
The Kubernetes Operator, secret, and MongoDB Kubernetes resources should
run in the same unique namespace.
This command returns a ConfigMap description in the shell:
Considerations¶
Starting in MongoDB Enterprise Kubernetes Operator version 1.3.0, you can only have one MongoDB resource per project. To learn how to deploy a MongoDB resource in your project, see Deploy Resources.
Next Steps¶
Now that you created your ConfigMap, Create Credentials for the Kubernetes Operator before you start deploying MongoDB resources.