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.

By aq
Hi,
I am currently running a managed postgres database and a kubernetes cluster in digital ocean.
These are both running in the same VPC
I have added the kubernetes cluster to the trusted sources of the managed database.
I am able to connect to the database from my local machine if I add my local ip to the trusted sources.
However, I am seeing that my connection keeps timing out when trying to connect to the database in one of my k8s pods.
My code looks like this (typescript):
import dotenv from 'dotenv';
import pg from 'pg';
dotenv._config_();
export const _pool_ = new pg._Pool_({
connectionString: process.env.DATABASE_URL,
connectionTimeoutMillis: 5000,
ssl:
process_.env.ENVIRONMENT !== 'local'
? {
rejectUnauthorized: true,
ca: _Buffer_._from_(
_process_.env.DATABASE_CRT as string,
'base64',
)._toString_('utf-8'),
} : undefined,
});
I pass the DATABASE_CRT and the DATABASE_URL via secrets -> env variables.
I base64 encoded the DATABASE_CRT.
I also created a small script that I ran in the pod with the DATABASE_CRT in-lined, also was timing out… This same code worked locally
I am using the VPC connection string as the DATABASE_URL, and the ca-certificate (I base64 encoded and placed in my secret) downloaded from the managed postgres page.
I was able to hit the database via telnet from the pod ie. curl -v telnet://<db-host>:<db-port>
Any advice?
fullammo
4ae272398ee6445a9bf73f4cd632b5
eddie
Taha Aziz Ben Ali
Telmo Valverde
Alexandre Herlinvaux
52d4eff26a544eefb189e2005836b2
EatingAquamarineScubaDiver
f25932a0b984430fb48c4256f1aaad
JuanPablo
fullammo
a67ecb62f684403a9548d56545d826