Simple Client Connecting to Google Cloud SQL using Cloud SQL Proxy

6/21/2017

I'm following this example of how to get wordpress running on GKE connected to Google Cloud SQL via the Google Cloud SQL Proxy:

https://cloud.google.com/sql/docs/mysql/connect-container-engine

Unfortunately, my wordpress pod is failing with a crashloop error, and it's not clear from the documentation how to dig deeper into the reason for this. Here is a sample of the error:

bash-3.2$ kubectl get pods| egrep wordpress
wordpress-713960421-v4f49     0/2       CrashLoopBackOff   16         20m

(kubectl describe pod ...)

11m   22s     36      kubelet, gke-noon-staging-default-  pool-d500b601-dfb6                                    Warning FailedSync         Error syncing pod, skipping: [failed to "StartContainer" for "web" with   CrashLoopBackOff: "Back-off 5m0s restarting failed container=web   pod=wordpress-713960421-v4f49_default(f64276d2-5660-11e7-a565-42010a9a0023)"
 , failed to "StartContainer" for "cloudsql-proxy" with    CrashLoopBackOff: "Back-off 5m0s restarting failed container=cloudsql-proxy    pod=wordpress-713960421-v4f49_default(f64276d2-5660-11e7- a565-42010a9a0023)"  
 ]

My questions are:

  • How to dig further into why the pod is failing to deploy with cloud sql proxy
  • Has anyone got an example working for using cloud sql proxy with as simple mysql client pod?

Here is a description of the deployment (kubectl describe wordpress):

https://pastebin.com/DjYM97R7

And a description of the pod (kubectl describe ):

https://pastebin.com/pN7gUZg8

Thanks in advance!

-- Traiano Welcome
cloud-sql-proxy
google-kubernetes-engine
kubernetes

0 Answers