How To Connect The Kubernetes Cluster to DigitalOcean Managed MongoDB with TLS Enabled?

Hello experts,

I am trying several way to access my Kubernetes cluster to DigitalOcean managed MongoDB which enabled TLS (as MongoDB 4.4).

Anyone have experiences to setup the Kubernetes cluster to connect to the TLS enabled MongoDB, I am very much appreciated.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @chanvi,

You can download the ca-certificate file from the MongoDB connection details from the database page and copy the content from the file to create crt file in the Kubernetes cluster.

The below link can guide you with downloading the ca-certificate file :

If you are facing any issue on this; you can try adding “tlsAllowInvalidCertificates” in the MongoDB connection string to connect without a ca-certificate.

mongo "mongodb+srv://" --tls --tlsAllowInvalidCertificates

For more information on TLS settings for Node js :

I hope this helps!

Regards, Rajkishore