The following procedure describes how to connect to a MongoDB resource deployed by Kubernetes from inside of the Kubernetes cluster.
You must be able to connect to the host and port where you deployed your Kubernetes resource. To learn more about connecting to your deployment, see Connect to a MongoDB Process.
Retrieve and run the connection command for your deployment. You can retrieve the connection command from the Ops Manager or Cloud Manager application, depending on where your clusters are hosted. You can also retrieve the connection command from the Kubernetes secret that the Kubernetes Operator creates automatically when you add a MongoDB user with SCRAM authentication or X509.
The procedure for connecting to a MongoDB Database resource varies based on how you want to retrieve your connection string: