Kind Quick Start¶
On this page
MongoDB Enterprise Kubernetes Operator uses the Kubernetes API and tools to manage MongoDB clusters. Kubernetes Operator works together with MongoDB Cloud Manager or Ops Manager. This tutorial demonstrates how to deploy and connect to your first replica set in Cloud Manager or Ops Manager from Kind with Kubernetes Operator.
Procedure¶
Configure kubectl
to default to your namespace.¶
If you have not already, run the following command to execute all
kubectl
commands in the namespace you created:
Install the MongoDB Enterprise Kubernetes Operator¶
Change to the directory in which you cloned the repository.
Install the CustomResourceDefinitions for MongoDB deployments using the following
kubectl
command:Install the Kubernetes Operator using the following
kubectl
command:
Create credentials and store them as a secret.¶
Run the following command:
Note
Provide your Public and Private Key values for the following parameters. To learn more, see Create Credentials for the Kubernetes Operator.
Invoke the following command to create a ConfigMap.¶
Note
Provide your values for the following parameters. To learn more, see the parameter descriptions.
Deploy the replica set resource.¶
Run the following command:
Create a secret with your database user password¶
You can choose to use a cleartext password or a Base64-encoded
password. Plaintext passwords use stringData.password
and
Base64-encoded passwords use data.password
.
Note
Provide your values for the following parameters. To learn more, see the parameter descriptions.
For a cleartext password, create and save the following YAML file:
For a Base64-encoded password, create and save the following YAML file:
Create a database user.¶
Run the following command:
Optional: View the newly created user in Cloud Manager or Ops Manager.¶
You can view the newly-created user in Cloud Manager or Ops Manager:
- From the Project’s Deployment view, click the Security tab.
- Click the MongoDB Users nested tab.
Connect to the replica set.¶
Perform the following steps in the Cloud Manager or Ops Manager application, depending on where your clusters are hosted:
- Click Deployment in the left navigation.
- Click for the deployment to which you want to connect.
- Click Connect to this instance.
- Run the connection command in a terminal to connect to the deployment.