Report this

What is the reason for this report?

Postgres CA Cert and Kubernetes

Posted on May 17, 2019

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?



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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.