Friday, March 9, 2018

[google-cloud-sql-discuss] Re: Cloud SQL Proxy hangs Kubernetes CronJob

The proxy doesn't run in the background by default. If you are running it in a bash script like environment, you may need to launch the process in the background by appending `&` to the end of the command. You can get the PID of the last background process ran with `$!`, and use that at the end of the script to kill the proxy when you are finished. 

On Friday, March 9, 2018 at 5:59:46 AM UTC-8, Valentin Agachi wrote:
Hello,

Has anyone run into issues when using the Cloud SQL Proxy inside a Kubernetes CronJob?

I'm using the SQL proxy inside other Kubernetes Deployments connected according to this guide: https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine - and this works fine.

However when I try to set up a CronJob with the same configuration for allowing my container to connect to Cloud SQL via the proxy, the cron job never finishes/completes and never triggers again. I have run my CronJob container without the Cloud SQL proxy container attached, and it completes correctly and gets rescheduled.

Any pointers on what could be done to safely close the Cloud SQL Proxy container once my job is complete?

Thanks!

--
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/64ef61bd-5781-49bc-af1d-76afa2bf0209%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment