Postgres CA Cert and Kubernetes

I have a managed postgres database with DO - connection string has sslmode = require in it.

For local development I have downloaded and trusted the CA certificate for our postgres instance and all works fine.

But now I have deployed our application to a kubernetes cluster on DO - and its failing because the CA Root is not trusted.

Is it possible to configure Kubernetes to download the CA and trust it on the underlying droplets?

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’ve found a solution in case anyone else comes along later.

I included my .crt file in my project so it got included with the binaries.

Then in my dockerfile I added these 2 liness in the final stage:

ADD [path from working dir to the CRT file] /usr/local/share/ca-certificates/DO-PG-CA.crt RUN chmod 644 /usr/local/share/ca-certificates/DO-PG-CA.crt && update-ca-certificates

Thanks for updating with a solution. This worked for me.