Thursday, October 25, 2018

[google-cloud-sql-discuss] Postgres refuses connection when trying to use Proxy with Kubernetes

Hi All,

I have an application written in python that streams tweets from Twitter into a PostGres database in Google Cloud Platform using SqlAlchemy. 

I built the docker image (exposing port 5432) and uploaded it to the container registry, and followed all of the steps to connect GKE to SQL in the "Connecting from GKE" guide. 

However, after following all of the steps and setting up the proxy, I keep getting the "connection refused" error from the database. 

Here are the things that I have checked:
  • Tested the script locally. If I use the public IP I set up for local connections, it works fine.
  • Re-built the docker image using the --no-cache flag to make sure my changes were actually implemented
  • Made sure that the Kubernetes Engine Service Agent had Admin access to Cloud SQL.
  • Changed the Host IP in my application from the DBs public IP to localhost, per the instructions.
  • Checked to make sure that the username/password were correct.
Any help you could offer would be greatly appreciated!

Best,
Nathan

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/05b9756c-e282-4bba-a319-ee2ce1f99f5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment