I was following the Django kubernetes series (How To Deploy a Scalable and Secure Django Application with Kubernetes | DigitalOcean
But I ran into a problem where the Django app that works fine in Docker can’t no connect to the digital ocean postgres after being deployed into Kubernetes. I then did some further exploration and launched postgresql-client pod, and I can’t seem to connect from it either, even though name lookup and so on seem to work. When trying to run this
psql -p 25060 -U sammy -d polls -h databasenamestring-0.b.db.ondigitalocean.com
from inside a pod it hangs, while the same command works from both a linuxvm droplet and also from my home comp. Also the name lookup for the database does work, nor does it work if I give the host ip address directly.
And of course most critically, the Django app can’t connect the database but hangs whenever it tries to access the DB in the back.
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.