By Chấn Vĩ
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.
Thanks
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!
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 :
https://docs.digitalocean.com/products/databases/mongodb/how-to/connect/
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://doadmin:password@db-mongodb-nyc3-xxxxxx-xxxxxxxxxxx.mongo.ondigitalocean.com/admin?authSource=admin" --tls --tlsAllowInvalidCertificates
For more information on TLS settings for Node js : https://mongodb.github.io/node-mongodb-native/3.5/tutorials/connect/tls/
I hope this helps!
Regards, Rajkishore
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
