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!
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.