title: GCloud - Can't access Cloud SQL from Kubernetes Cluster but it works from local PC
body: <p>I want to connect to my Cloud SQL Database (MySQL) from a container running in the GCloud Kubernetes Engine via JDBC. The container contains a Java Spring Boot application with some REST services.</p>
  
  <p>When I run my Java application locally, everything works fine and the application connects to the Cloud SQL DB just fine. However when I deploy my app to the GCloud, I only get this response, when I call my server REST API (via Postman):</p>
  
  <pre><code>{
  "timestamp": "2018-09-27T06:54:22.987+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "Could not open JDBC Connection for transaction; nested exception 
  is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications 
  link failure\n\nThe last packet sent successfully to the server was 0 
  milliseconds ago. The driver has not received any packets from the server.",
  "path": "/api/user/getDbs"
  }
  </code></pre>
  
  <p>I already tried to allow all connections to the Database, via adding 0.0.0.0/0 in the authorization tab.
  I also tried to add firewall rules. Both without any success.</p>
  
  <p>I appreciate any help, I can get :)</p>